Can I completely rely upon jQuery\'s html() method behaving identical to innerHTML? Is there any difference between innerHTML and jQue
html()
innerHTML
To answer your question:
.html() will just call .innerHTML after doing some checks for nodeTypes and stuff. It also uses a try/catch block where it tries to use innerHTML first and if that fails, it'll fallback gracefully to jQuery's .empty() + append()
.html()
.innerHTML
try/catch
.empty()
append()