Which of the following is the correct syntax for accessing the value of the href attribute for

Question:

Which of the following is the correct syntax for accessing the value of the href attribute for the third a element in a document? 

a. document.getElementsByTagName("a")[2].href

b. document.getElementsByTagName("a")[3].href

c. document.getElementById("a").href

d. document.getElementsByTagName("href")[3]

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

JavaScript

ISBN: 9781305078444

6th Edition

Authors: Sasha Vodnik, Don Gosselin

Question Posted: