jquery select multiple code example
Example 1: jquery or selector
$( "div, span, p.myClass" ).css( "border", "3px solid red" );
Example 2: jquery multiple selectors
Html:
<div>div</div>
<p class="myClass">p class="myClass"</p>
<p class="notMyClass">p class="notMyClass"</p>
<span>span</span>
Js:
<script>
$( "div, span, p.myClass" ).css( "border", "3px solid red" );
</script>
Example 3: jquery select2 multiple select all
$("#checkbox").click(function(){
if($("#checkbox").is(':checked') ){
$("select > option").prop("selected","selected");
}else{
$("select > option").removeAttr("selected");
}
});
Example 4: how to select multiple jquery element at once
$("tagName1, tagName2, tageName3")
$(".className1, .className2, .className3, .className4")
$("#idName1, #idName2")