Home >Web Front-end >JS Tutorial >jquery traverses select elements (explanation with examples)_jquery

jquery traverses select elements (explanation with examples)_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:06:001402browse

This article provides a jquery traversal select tutorial code, which mainly uses the form of $("# option").each(function() { to traverse each once, so All selections are queried once

Copy code The code is as follows:



aaass


Method 2
function autoscrollregion() {
var reg_name = $("#").val();

         $("# option").each(function() {
                                                                                   this).attr("selected", "selected");
break;
}
});
}

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