I have some code that looks like this:
document.getElementById("error").style.display = 'block';
and when this happens I also want to display the error that is supposed to be shown which is stored in another JS variable. How can I add the value of that variable to the div which has id="error"
Thanks!
var errorMsg = "<p>Example error message</p>"
document.getElementById("error").innerHTML = errorMsg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With