0 votes
in JavaScript by

Choose the correct JavaScript syntax to change the content of the following HTML code.

a) document.getElement ("letsfindcourse").innerHTML = "I am a letsfindcourse";

b) document.getElementById ("letsfindcourse").innerHTML = "I am a letsfindcourse";

c) document.getId ("letsfindcourse") = "I am a letsfindcourse";

d) document.getElementById ("letsfindcourse").innerHTML = I am a letsfindcourse;

1 Answer

0 votes
by
Answer:-  B

Reason:The correct syntax to access the element is document.getElementById("letsfindcourse"). Here we want to access the content written under that id, so we used .innerHTML to specify that and finally we replaced the content with whatever is written inside the quotes.

Related questions

0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
0 votes
asked Mar 23, 2021 in JavaScript by sharadyadav1986
...