Wednesday, September 29, 2010

jQuery Selectors: Select elements using Id

Selecting HTML elements with Id.


The # selector selects an element with a unique id.

write the following in html head section
<script type="text/javascript">
function DisplayAll() {"#divDetails").text("Welcome to my first jQuery application.");</script>

write the following in the body.

<div id="divDetails"></div><hr />
<div></div><hr /><div></div><hr /><div></div><hr />

No comments: