1.HTML
HTML (): Gets the HTML content of the first matching element. This function is not available for XML documents. But can be used for XHTML documents
HTML (val): Sets the HTML content for each matching element. This function is not available for XML documents. But can be used for XHTML documents.
2.TEXT
Text (): Gets the contents of all matching elements.
The result is text that is combined with the text content contained by all matching elements. This method works for both HTML and XML documents.
Text (val): Sets the textual content of all matching elements
Similar to HTML (), but will encode HTML (replace "<" and ">" with the corresponding HTML entity).
3.VAL
Val (): Gets the current value of the first matching element.
Val (val): Sets the value of each matching element. The contents of the
are copied in the Help documentation for jquery, and are no more than nonsense. Here are some of the exercises you've done, the code is as follows:
While I was doing the exercise I found another different place for HTML and text
HTML () to the content of the elements, the selected elements of the following format can also be taken.
such as: <div id= "Divshow" ><b><i>write less do more</i></b></div>
If we use Var strHTML = $ ("#divShow"). html ();
The result is: <b><i>write less do more</i></b>
If we use Var StrHTML2 = $ ("#divShow b I"). html ();
The result is write less do
and text does not have the first case,
if we var strText = $ ("#divShow"). Te XT ();
result is write less do more
<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%> <% String Path = Request.getcontextpath ()
;
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/"; %> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
Everyone can also go to the verification, the above is my experiment, I use jquery is 1.6