View Full Version : jQuery adding class to a .append element

06-24-2010, 06:27 PM
I'm working on this jquery menu and I have a conflicting element that I need to tie down with CSS. How can I add a class to an element that is inside .append?


$("ul.subnav").parent().append("<span class='image'>"); (example of what I want)

06-27-2010, 12:01 PM
What you've got will work in FF, Chrome etc. For IE have a try with:

$("ul.subnav").parent().append("<span class='image'></span>");

IE being a pain as usual.