It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes how to get the class name of 'th' under a table  from javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to get the class name of Watch "how to get the class name of New topic
Author

how to get the class name of 'th' under a table from javascript

jack fe
Greenhorn

Joined: Nov 10, 2009
Posts: 16
Guys:
I have a known value got from server.
If it is 0, then I need to know class name of <th> for 'Site ID'.
If it is 1, then I need to know class name of <th> for 'Site Name'.

how to use javascript to do that?
Thanks.

code:
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Code all spaced out


Code combined to a line



And if you were using jQuery:



Eric

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to get the class name of 'th' under a table from javascript
 
Similar Threads
display:column + javascript
Populate a dynamic table with data using JQuery
question for Struts 1.1 tld
Set Table Column Width in CSS
jQuery doubt with reference to Object Literal Example.