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()
Related Contents:
- Can scripts be inserted with innerHTML?
- jQuery document.createElement equivalent?
- How can I select an element by name with jQuery?
- What is the most efficient way to create HTML elements using jQuery?
- How do I create a link using javascript?
- Finding line-wraps
- How to get the element clicked (for the whole document)?
- Why are duplicate ID values not allowed in HTML?
- How to show Page Loading div until the page has finished loading?
- Is there a DOM event that fires when an HTML select element is closed?
- How to find a parent with a known class in jQuery?
- jQuery: how to change tag name?
- Why do multiple `.appendTo` calls on a newly created jQuery element only append it once?
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- How can I get access to a Highcharts chart through a DOM-Container?
- Open new window without focus on it [duplicate]
- HTML-encoding lost when attribute read from input field
- jQuery Data vs Attr?
- HTML text input allow only numeric input
- Cross domain iframe issue
- Get file size, image width and height before upload
- When should I use jQuery’s document.ready function?
- Chrome extension – retrieving global variable from webpage
- How to do a Jquery Callback after form submit?
- Prevent contenteditable adding on ENTER – Chrome
- jQuery UI accordion that keeps multiple sections open?
- how to make a jquery “$.post” request synchronous [duplicate]
- How to silently hide “Image not found” icon when src source image is not found
- HTML5 Local Storage fallback solutions [closed]
- Hide scrollbar while still being able to scroll with mouse/keyboard [duplicate]
- Change color of specific words in textarea
- How to blur the div element?
- jQuery count child elements
- HTML anchor link – href and onclick both?
- width/height after transform
- How do you detect the clearing of a “search” HTML5 input?
- scrollTop animation without jquery [duplicate]
- How to make supported on all browsers? Any alternatives?
- Populate one dropdown list based on the selection of other dropdown list
- Center flex item in container, when surrounded by other flex items
- how to disable DIV element and everything inside [duplicate]
- How do I get the content of a using jQuery?
- How can I set preview of video file, selecting from input type=’file’
- Select div using wildcard ID
- Is there any problem with using HTML5’s “data-*” attributes for older browsers?
- Click on option event
- How to replace html element with ajax response?
- submit event does not fire if submit initiated programmatically
- Remove ‘All Files’ option from HTML file input
- Set focus and cursor to end of text input field / string w. Jquery [duplicate]