+ 4
Javascript question [Solved]
https://code.sololearn.com/W13VPtCiUsbl/?ref=app In the code, while displaying the notes, the time displayed is when the page loads, how can I display the time when the submit button is clicked?
6 Antworten
+ 1
Tarush Mohindru
You can use the same method used in function `app` for getting a new Date object and query the hour, minute and second, only this time you apply it inside the add button click event handler $("#add").on("click",function(). I think you can do this 👍
+ 3
<body onload="">
<button id="add" onclick="app()">Submit</button>
+ 2
You are using variable <h>, <m>, <s> and <ampm> which is initialized when the page loads. You need to use a current Date object to use the time of submission. Focus on line 50.
+ 2
Ipang could you please help me with the syntax
+ 2
Thanks Ipang, the problem is solved
+ 1
Good job bro! 👍