To select multiple elements having different attributes, multiple selector can be used. We can mix the class selector, element selector, id selector all in this selector separated by “,”
(comma).
<script language="javascript" type="text/javascript">
$("p.class1, #p1").css("border", "5px solid green");
</script>
Above code will
class
attribute set as “class1” and apply css style border width as 5 pixel, style as solid and color as green.
Views: 7518 | Post Order: 14