Examveda
Examveda

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(); }

Answer: Option B

Solution(By Examveda Team)

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

Join The Discussion

Related Questions on Server Side and Client Side Scripting