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
Release: 2016-05-16 17:28:26
Original
1275 people have browsed it

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:



Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template