Home > Web Front-end > JS Tutorial > body text

js/jquery method to obtain input focus of text box_javascript skills

WBOY
Release: 2016-05-16 16:57:29
Original
1239 people have browsed it

Method 1,

Copy the code The code is as follows:

function CheckForm() {
           if (document.form1.trainingName.value==""){
                                                                                                                                                                                                                                                          ; );
                                       return false; 🎜> Copy the code


The code is as follows:

function CheckForm() {
var classLevel = $("#classLevel").val();
var re = /^[1-9][0-9]*$/;
if(!re.test( classLevel)&&classLevel.length>0){                                     alert("Please enter an integer greater than zero!"); > } }
Related labels:
js
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