jQuery each terminates or skips example code_jquery
May 16, 2016 pm 05:09 PMWhen iteration is involved, abnormal termination or forced skipping is inevitable. In jQuery's each function, there is the following relationship:
continue :return true;
break :return false;
Direct return will also jump out of jQuery.
Set the drop-down list to select and terminate the iteration
$("#area option").each(function(){
if($(this).text()==addrTmp[2]){
$(this).attr("selected ", "selected");//
return false;
}
});

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Win11 Tips Sharing: Skip Microsoft Account Login with One Trick

Detailed explanation of jQuery reference methods: Quick start guide

How to use PUT request method in jQuery?

How to remove the height attribute of an element with jQuery?

jQuery Tips: Quickly modify the text of all a tags on the page

Use jQuery to modify the text content of all a tags

How to skip the beginning and end of songs in Kugou Music_How to skip the beginning and end of songs in Kugou Music

Understand the role and application scenarios of eq in jQuery
