Recent Comments

    getElementsByTagName

    All we know that getElementsByTagName() a DOM function in Javascript is used to get all the child elements for an particular element.Consider this following scenario I have an table with the id as “parentTable”, which has many child tables in it. so my structure will be like this,
    			<table id='parentTable'>
    				<tr>
    					<td>
    						<table id='childTable1'>
    							<tr>
    								<td>My First Article</td>
    							</tr>
    						</table>
    					</td>
    				</tr>
    			</table>
    		
    If i’m going to use parentTable.getElementByTagName(“tr”), i’ll be getting the count as 2, Which is what i’m not looking for. I wanted to get the count as 1.Guys please give some alternative suggesstion.

    Leave a Reply

     

     

     

    You can use these HTML tags

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>