Ejemplo 1: elemento de selección de jquery con dos clases
$('.class1.class2') // select element that has both class1 and class2
Ejemplo 2: selectores múltiples de jquery
/*
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</p>
<p class="notMyClass">p</p>
<span>span</span>
Js:
<script>
$( "div, span, p.myClass" ).css( "border", "3px solid red" );
</script>
/*
I Hope it will help you.
Namaste
*/
Ejemplo 3: jquery selecciona 2 clases
$(".class1, .class2, .class3") //select classes independently
Ejemplo 4: jquery múltiples clases
$(".intro, .demo, .end")
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)