Which of the following is the correct syntax for accessing an element with the id value headline?

Question:

Which of the following is the correct syntax for accessing an element with the id value headline?

a. document.getElementsByID("headline")

b. document.getElementById("headline")

c. document.getElementByID("headline")

d. document.getElementById(headline)

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: