I am currently working through this tutorial: Getting Started with jQuery
For the two examples below:
$(\"#orderedlist\").find(\"li\").each(function
When using jQuery
, it is advised to use $(this)
usually. But if you know (you should learn and know) the difference, sometimes it is more convenient and quicker to use just this
. For instance:
$(".myCheckboxes").change(function(){
if(this.checked)
alert("checked");
});
is easier and purer than
$(".myCheckboxes").change(function(){
if($(this).is(":checked"))
alert("checked");
});