JavaScript gets the method for the first anchored text on a page

  • 2020-05-26 07:42:46
  • OfStack

This example shows how JavaScript gets the first anchored text on a page. Share with you for your reference. The details are as follows:

The JS code below gets the innerHTML of the first archor through the document.archors array

<!DOCTYPE html>
<a name="html"></a><br>
<a name="css">CSS Tutorial</a><br>
<a name="xml">XML Tutorial</a>
<p>innerHTML of the first anchor:

The above code output:

I hope this article is helpful for you to design javascript program.

Related articles: