jQuery is JavaScript library which contains predefined methods like show(), hide() etc. In Javascript we are required so many lined of code for hide and display particular section, but in jQuery we are required only single line of code. for using jQuery we required js file which contains all the predefined methods. Download jquery js […]
jQuery is the library of javascript functions. $ is used for accessing functions which are defined in library.
What is $(document).ready() ? Before you can safely use jQuery to do anything to your page, you need to ensure that the page is in a state where its can be manipulated. like as : $(document).ready(function(){ alert(“Page is ready for manipulation.”); }); $(document) is used for creating object of our page document. ready() is used […]
$(‘li’).html(‘New HTML’); // this replaced all list items on your page with specified contents. $(‘div’).html(‘New Div Contents’); // this replaced all div contents on your page with specified contents. $(‘body’).html(‘New Body Contents’); // this replaced all contents of body part of your page. $(‘p’).html(‘New Paragraph contents’); // this replaced all paragraphs on your page with […]
$(‘div’).addClass(‘active’); // here active is the class name which you want to apply on your html page. // div is the element on which you apply specified class.