SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: how to get...attribute?
-
Aug 2, 2006, 07:54 #1
- Join Date
- Dec 2005
- Location
- New York, NY, U.S.
- Posts
- 128
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
how to get...attribute?
I'm trying to get the text inside of a link element. So lets say i had
Code:<a href="blah">Text</a>
-
Aug 2, 2006, 09:37 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
attribute
In <a href="blah">Text</a>, href is the attribute, so you can use getAttribute to get "blah". If you want to get "Text", try innerHTML or childNode/textNode
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Aug 2, 2006, 09:42 #3
- Join Date
- Dec 2005
- Location
- New York, NY, U.S.
- Posts
- 128
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I just remembered about childnodes, so on
Code:<a href="blah">Text</a>
Bookmarks