With JQuery, I am targeting the following:
<li style="margin-left: 15px;">blah<li>
with this code:
$(".block-category-navigation li[style='margin-left: 15px;']").addClass('sub-menu');
It works great in firefox, but doesn’t work at all in IE. Does IE ignore the style selector? Anyway around if so
After checking this in IE8’s console, I found that it’s turning ‘margin-left’ into ‘MARGIN-LEFT’.
In IE this selector will work:
You could either have both upper & lower case selectors, or use a loop to check the style attribute like so:
UPDATE
Since I don’t want to give you code that doesn’t work, I’ve setup this working example here: http://jsfiddle.net/YB7uV/6/