Get child id
I have this code:
I want to get the content of <h2> tag based on Subscribe1.So end result will be "Subscribe To"
<div id="Subscribe1" class="widget Subscribe">
<div style="white-space: nowrap;">
<h2 class="title">Subscribe To</h2>
Or other way round,
Is there any way if the id is Subscribe1 then remove <div style="white-space: nowrap;">
1. The reference of the textNode inside that <h2></h> element is
2. to remove that div when? When the user does what?
You have saved my life.
Just a question:
If there is second h2 tag then should it be like
What does this firstChild indicate?
Please ignore about removing the child.
Thanks once again
1. getElementsBytagname() returns a collection (very much alike an array), thus, yes, the second <h2> elements will have the index 
2. textNodes are child nodes as well. Thus firstChild (or could be also childNodes) is what its name says: the first child of the element h2, which is the textNode (the string) written there.
See DOM (Document Object Model):
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)