Q. What is the code snippet to update the content of the timestamp element when the user clicks on it?
β
Correct Answer: (B)
timestamp.onclick = function() { this.innerHTML = new Date().toString(); }
Explanation: The above code snippet updates the content of the timestamp element when the user clicks on it.