Thread: jQuery Why am I such a noob?
View Single Post
Old 09-22-2012, 03:38 PM   PM User | #3
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
Code:
$("div.tableborder").hasClass("postlinksbar").attr("id","topictext");
is not working becuase this does not match your html structure.

this line basically says find the div that has a class ov tableborder and also has a class of postlinksbar.

in your html postlinksbar is inside of a div with a class of tableborder

so if you wan to set the id of that div to "topictext"

then :

Code:
$("div.tableborder > .postlinksbar").attr("id","topictext");
and your a noob becuase you are learning, don't be so hard on yourself . So please read the posting rules in regards to subject titles. " im a noob" doesnt help much
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote