Home >Web Front-end >JS Tutorial >js code to verify when the mouse focus leaves the text box_javascript skills

js code to verify when the mouse focus leaves the text box_javascript skills

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

Use js to verify the value of the text box

Copy code The code is as follows:

<script> <br>function onblurs(){ <br>if(frm.name.value==""){ <br>alert("Please enter your name!"); <br>}else if(frm.funny. value==""){ <br>alert("Hobby cannot be empty!"); <br>} <br>} <br></script>

Your name:


Your hobbies:



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