Home >Web Front-end >JS Tutorial >js/jquery method to obtain input focus of text box_javascript skills

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:57:291290browse

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!"); > } }
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