I\'m attempting to use attribute selectors and CSS for formatting elements.
The HTML looks like:
User Name
You are setting the attribute to JavaScript true
and false
, not string "true"
and "false"
. This could be interpreted by the browser as 1
and 0
and lead to unwanted results.
Can you try
node.setAttribute('highlight', 'true');
?
to avoid inevitable cross-browser compatibility issue's with javascript/css I would recommend using jQuery.
For example, to highlight an element via the jQuery framework this is all that it takes...
$("div").click(function () {
$(this).effect("highlight", {}, 3000);
});
You're using unknown attribute hightlight
. It's IE so it supports attributes according to its name (what's seems to be harder than supports every attribute name, but... it's IE).
Just use class="hightlight"
- easier to implement and deal with.
Make sure you have DOCTYPE defined at the top of the page: Css attribute selector for input type="button" not working on IE7
Check to make sure you have a DOCTYPE defined at the top of your page: Css attribute selector for input type="button" not working on IE7