1.

For displaying data in JavaScript, we can’t use ____________(a) document.write()(b) console.log()(c) innerHTML(d) document.getElementById()I have been asked this question in unit test.Enquiry is from Essential JavaScript and jQuery topic in section HTML Tables, Javascript & Jquery Basics of HTML

Answer»

Correct choice is (d) document.getElementById()

For explanation I would say: We can display data in many WAYS in JAVASCRIPT.They are innerHTML, console.log(), window.alert(), document.write. document.getElementById(id) is a method used for ACCESSING HTML element by JavaScript. Here id defines the HTML element.



Discussion

No Comment Found

Related InterviewSolutions