Alex Rivera | Logout

How do you change the style of a div programmatically

Asked 2008-09-20T19:46:42.980
11

How do I change the style (color) of a div such as the following?

"<div id=foo class="ed" style="display: <%= ((foo.isTrue) ? string.Empty : "none") %>">
                        <%= ((foo.isTrue) ? foo.Name: "false foo") %>"`
Edit
Report

1 Answer

2

Generally, you can do it directly

document.getElementById("myDiv").style.color = "red";

There's a reference here.

answered 2008-09-20T19:54:30.963

Your Answer