...

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



pcproff
06-24-2010, 05: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>");


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

SB65
06-27-2010, 11:01 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum