I know that innerhtml() function can be used in javascript. Do we have any difference with the html() function? What is it?
Both Javascript and Jquery do the same thing of replacing innerhtml with some string. Jquery innerhtml() format is shorter than javascript innerhtml().
Look at the example below:
document.getElementById('mydiv').innerHTML = "Hello World";
With jQuery you can simply type:
$('#mydiv').html("Hello World");
Make sense?
Both Javascript and Jquery do the same thing of replacing innerhtml with some string. Jquery innerhtml() format is shorter than javascript innerhtml().
Look at the example below:
With jQuery you can simply type:
Make sense?