Hello,
I’m looking for a simple alternative to the :contains below since it will match on multiple elements such as “Blog” and “Blog Archive” if in the same UL.menu LI A …
$("UL.menu LI A:contains('Blog')").append('Something...');
Thanks!
Hello,
I’m looking for a simple alternative to the :contains below since it will match on multiple elements such as “Blog” and “Blog Archive” if in the same UL.menu LI A …
$("UL.menu LI A:contains('Blog')").append('Something...');
Thanks!
Do you know for sure what the text will be? If so you can do something like:
$("UL.menu LI A:contains('Blog'), UL.menu LI A:contains('Blog Archive')").append('Something...');
... instead of doing a wild card.
Hello,I’m looking for a simple alternative to the :contains below since it will match on multiple elements such as “Blog” and “Blog Archive” if in the same UL.menu LI A …
$("UL.menu LI A:contains('Blog')").append('Something...');Thanks!
$("UL.menu LI A").each(function(){
if($(this).html() == "Blog"){
$(this).append("something");
}
});
COPYRIGHT © 2012 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.