Tuesday, May 1, 2012

jQuery Selectors

jQuery Selectors

Here are some great and easy jquery selector .

1: How to find all the the elements of a web Page.


<script type="text/javascript">

// ('*') is used for all the element of a web page.


var count=$('*').length;
alert(count);

// ('p') It will count all the P tag of a web page.

var count=$('p').lenght;
alert(count);



// ('#idname') It will count all the tag within this element. For example #idname is a div and have 4 element //inside it. then this selector will count element inside this only.


var count=$('#idname').lenght;
alert(count);



</script>


1 comment:

Please Comment Here and make this blog better.