jQuery > Selectors

Element Selector in jQuery

How to select all elements of specific type in jQuery?


To select all elements of specific type, we can use element selector.  We need to use the html tag name as css class.

<script>
$("p").css("border", "5px solid green");
</script>

Above code will select all p (paragraph) elements of the web page and apply css style border width as 5 pixel, style as solid and color as green. 

 Views: 7475 | Post Order: 12



Write for us






Hosting Recommendations