I am trying to create this button for a custom field that I have on my website
<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.</button>
The thing is, when i hit the button to show me the input from a custom field that I have on my wordpress site. I put the name on the field instead of 'Date()
' and the id of the div i have but nothing happens. Problem is i don't know what code should I write in order to do just that.
Update(based on brownian): So, this is an infographic that explains better what i need: