•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,221 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,263 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 970 | Replies: 6
![]() |
| |
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I claim First Post!
How do we access class names?
For example, this code:
If you want to parse html and find the title element you can find the class name "the-title".
That's what I am trying to do.
How do I do that?
Thank you,
Antoine
I claim First Post!

How do we access class names?
For example, this code:
<td class="the-title" align=left>The Title!</td>
If you want to parse html and find the title element you can find the class name "the-title".
That's what I am trying to do.
How do I do that?
Thank you,
Antoine
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 336
Reputation:
Rep Power: 0
Solved Threads: 32
Hi
there is no direct way to get elements by class name.
but you can access the class name attribute using dom api:
take help of following example:
as i have done for href you can do with class. Right !!!
there is no direct way to get elements by class name.
but you can access the class name attribute using dom api:
take help of following example:
html Syntax (Toggle Plain Text)
<html> <head> <script> function clickMe() { var aElems=document.getElementsByTagName('a'); var href=aElems[0].getAttribute('href'); alert('href='+href); } </script> </head> <body> <a href="javascript:clickMe();">click</a> </body> </html>
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
~Mitch Ratcliffe
Maybe a custom function like getElementsByClassName() ?
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
Actually, I am trying to parse messages from my Yahoo forum into my access 2003 database and yahoo works in a way that only allows for classes to id what you want. That's why I need to understand the DOM and figure a way through it...
Thank you

Antoine
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: text boxes w/ html
- Next Thread: start-date end-date Validation



Hybrid Mode