为什么隐藏窗体失去焦点时不显示?当离开输入时,警报很好地出现,但其他隐藏表单仍然不存在。
html
<body>
<input type="text" id="myinput" value="">
<input type="hidden" id="validation_message_email" value="enter a valid email">
</body>
javascript
window.onload = function() {
$("#myinput").blur(myAlert);
};
function myAlert() {
alert("This input field has lost its focus.");
$("#validation_message_email").show();
}
最佳答案
您无法显示这样的隐藏输入。跨度更适合此目的,
<input type="text" id="myinput" value="">
<span style="display:none" id="validation_message_email">enter a valid email</span>
关于javascript - 显示隐藏的输入 javascript/jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37569002/