java java - 4 months ago 7
Javascript Question

Show hidden input javascript/jquery

Why is the hidden form not shown when the other input looses focus? The alert is coming up nicely when leaving the first input but the other hidden form is still not there.



<input type="text" id="myinput" value="">
<input type="hidden" id="validation_message_email" value="enter a valid email">



window.onload = function() {



function myAlert() {

alert("This input field has lost its focus.");



You can't display a hidden input like that.A span will suit better for this purpose,

<input type="text" id="myinput" value="">
<span style="display:none"  id="validation_message_email">enter a valid email</span>