JQuery
Check the following code ... where we assign a lambda function(are u c# developer?) to all respective TYPES
<img src="http://www.janaganamana.net/favicon.ico" />
<img src="http://www.janaganamana.net/favicon.ico" />
<img src="http://www.janaganamana.net/favicon.ico" />
<p>clean this text by clicking</p>
<p>clean this too..</p>
<p>me too!</p>
<script type="text/javascript">
$(document).ready(function () {
$("img").click(function () { $(this).hide(); });
$("p").click(function () { $(this).hide(); });
});
</script>
$("img"). or
jquery("img").
$ nothing but a
function jquery(....)
{
}
and this function returns the target element(s)
In CSS also we assign styles to elements. Also programmatically. we have to find elements by their id or class or type etc...
Same is the case with Jquery.
we can find elements by id or class or type or classINclass or classINtype or etc...
$(this).hide() - hides me.
$("p").hide() - hides all paragraphs.
$("p.test").hide() - hides all paragraphs with class="test".
$("#test").hide() - hides elements with id="test".(expect only one!!)