A

Admin • 828.03K Points
Coach

Q. What is the code snippet to update the content of the timestamp element when the user clicks on it?

  • (A) timestamp.onLoad = function() { this.innerHTML = new Date().toString(); }
  • (B) timestamp.onclick = function() { this.innerHTML = new Date().toString(); }
  • (C) timestamp.onload = function() { this.innerHTML = new Date().toString(); }
  • (D) timestamp.onclick = function() { innerHTML = new Date().toString(); }
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
The above code snippet updates the content of the timestamp element when the user clicks on it.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.