jquery select multiple id code example
Example 1: jquery or selector
$( "div, span, p.myClass" ).css( "border", "3px solid red" );
Example 2: jquery multiple selectors
/*
If we want to apply same functionality and features to more than one selectors then we use multiple selector option.
I think we can say this feature is used like reusability. write a jquery function and just add multiple selectors in which we want same features.
Kindly take a look in below example:
*/
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>
/*
I Hope it will help you.
Namaste
*/
Example 3: multiple elements with same id jquery
<div id="x1">A</div>
<div id="x1">B</div>
<div id="x2">C</div>
<script>
console.log($('[id="x1"]'));
</script>
Example 4: select multiple id in jquery
$("#upload_link,#upload_link2,#upload_link3").upload(function(){ });