element selector in jQuery with example

element selector returns all the element with the specified element name.

Example :

    <title>Element Selector</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
    <script type="text/javascript">
    <div>This is div.</div>
    <button>Click Me</button>
    <button onclick="location.reload()">Reset</button>

Demo :

In the above example, we have used element selector. Element selector selects all the elements with the specified element. In above example, it selects the div element and applies CSS to it.


Post a Comment