How to get All I tags inside an element with id ‘header’ ?
Now we understood what is ID selector, class selector and to select elements, putting all together we will try to answer the above question
For ex: $('#header >I') - Gets get All I tags inside an element with id ‘header’ .
ID Selector with on Click Event
$('#header >I') .Click(function()
{ //Open
alert(this.innerHTML);
}); // Close
Here we are firing click event means that, the mouse click event fires the function.
And the corresponding operations in the event are fired. In this case a simple alert message.
Class Selector with Mouse Over Event
$('.content').mouseover(function()
{
this.innerHTML = 'Content Replaced';
});
The above code snippet select all the elements that has class ‘content’,Mouse over of the element content/ text associated with element will be replaced
Here Methods can be applied to sequence of objects.