Home » HTML » Html miscellaneous » Question
  1. For displaying data in JavaScript, we can’t use ____________.
    1. innerHTML
    2. document.getElementById()
    3. console.log()
    4. document.write()
    5. None of these
Correct Option: B

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.



Your comments will be displayed only after manual approval.