|
|
 |
| Javascript General Javascript discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 19th, 2005, 07: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, 07: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, 07: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, 07: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
|
|
|
|
 |