Take the Append () implementation of jquery as an example
append:function () { returnthis. Dommanip (arguments, function (elem) { if This 1 This One This 9 ) { varthis, elem); // will be implemented in the following Target.appendchild (Elem);}} );}
Implementation of Manipulationtarget ():
function manipulationtarget (elem, content) { return jquery.nodename (elem, " table ") && Jquery.nodename (content.nodetype !== 11 ? Content:content.firstChild, " tr "? Elem.getelementsbytagname ( " tbody ") [0 ] | | Elem.appendchild (elem.ownerDocument.createElement ( " tbody "
To see the manipulation () implementation above, note that the three-mesh operator is less than the priority of operator &&, so Manipulationtarget () returns the Elem or returns TBODY and its innerhtml;
The NodeName method of jquery has to be viewed on its own page.
jquery Source Parsing----internal Insert external function