boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

JavaScript getElementsByTagName Method Example

Updated on     Kisan Patel

To find out the html elements by their tag names, we need to use JavaScript getElementsByTagName method.

<script type="text/javascript" language="javascript">
function TestFunction() {
 alert(document.getElementsByTagName("label")[0].innerHTML);
}
</script>
<label>Hello World!</label>
<label>Hello India!</label>
<label>Hello USA!</label>
<input type="button" id="btnTest" onclick="TestFunction()" value="Click me" />

Javascript getElementsByTagName method can be used to find all the elements of the page using the tag name. It returns all the elements in the form of array.

In the above function, getElementsByTagName finds all html elements by tag name. “length” property can be used to know the number of elements found on the page and indexer can be used to access a particular element.

In the above code snippet, we are retrieving the first label of the page and display content inside this label in alert.

See the Pen rVRqQW by Kisan (@pka246) on CodePen.


JavaScript

Leave a Reply