Home  >  Article  >  Web Front-end  >  鼠标焦点离开文本框时验证的js代码_javascript技巧

鼠标焦点离开文本框时验证的js代码_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:28:261202browse

利用js来验证文本框的值

复制代码 代码如下:

<script> <BR>function onblurs(){ <BR>if(frm.name.value==""){ <BR>alert("请输入您的名字!"); <BR>}else if(frm.funny.value==""){ <BR>alert("爱好不得为空哦!"); <BR>} <BR>} <BR></script>


你的姓名:


你的爱好:



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn