Happy new year Happy new year - 4 months ago 9
jQuery Question

Simple display date not show

My JavaScript not working.
Please give me solution.

<button type="button" on click="getElementById('date').innarHTML=Date()">Click to show Date</button>
<p id="date"></p>

Answer

Spelling mistack of innerHTML as innarHTML. To change this correction for run your script.

<button type="button" on click="getElementById('date').innerHTML=Date()">Click to show Date</button>

<p id="date"></p>