JQuery

摘要:JQuery - .html() (how to get a html content)


Record how to use it.   URL

n an HTML document, .html() can be used to get the contents of any element. If the selector expression matches more than one element, only the first match will have its HTML content returned. Consider this code:

1

$( "div.demo-container" ).html();



In order for the following 

's content to be retrieved, it would have to be the first one with  in the document:

1
2
3



Demonstration Box





The result would look like this:

1

Demonstration Box