|
|
 |
| Javascript General Javascript discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

January 19th, 2005, 06:07 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
.syntax not working with class
I thought one could access attribute properties with . syntax, but not so with class?
I captured several tags by there ids
z.B. firstRef = docPath.getElementById("row0");
but firstRef.class doesn't work, but firstRef.attributes[3].nodeValue returns "rowColourDark" and firstRef.attributes[3].nodeName returns "class"
firstRef.attributes[3].specified returns "true" so why can't I access the class value with . syntax like I can access ID etc., etc.
|

January 19th, 2005, 06:09 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Using latest version of IE on windows xp.
I don't mind changing and reading class values with the attributes array as long as the element number is constant, is it always 3?
|

January 19th, 2005, 06:15 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Incase it matters, the html was created with php which pulled data from an xml file and created a table. I don't think this should matter as I can capture tags by there ID and manipulate input fields with javascript so I should be able to access the class with . syntax I think.
|

January 19th, 2005, 06:21 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
in script u need to use className not class to capture this attribute - it was done like this because class is a reserved word in many languages
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |