In jQuery, accessing HTML elements is based on CSS selectors. You can use the HTML element, element id attribute or element class name to for reference purposes.

View this file using web browser. If everything works fine, you ‘ll see the alert message.

Example 2 : Hide content

$(document).ready(function()
{
$('div#content').hide();
});

Add the above code snippet within javaScript section and add a div container with some dummy text within body section. The div id is content for this scenario. When the browser loads the page you won’t see the text within the div container.