1. After function
Definition and Usage:
The After () method inserts the specified content after the selected element. Reference: http://keleyi.com/a/bjac/cfyxd60g.htm
Grammar:
$ (selector). After (content)
Instance Effect experience: http://keleyi.com/keleyi/phtml/jquery/13.htm
Instance code:
<HTML><Head><title>The After function instance of jquery-Ke Keeper</title><BaseTarget= "_blank" /><Scripttype= "Text/javascript"src= "Http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></Script><style>. yuanlai_keleyi_com{Border:1px solid Black;padding:5px}. a_keleyi_com{Color:Blue;}a{Color:Blue}</style></Head><Body><BR/><spanclass= "Yuanlai_keleyi_com">Collayi, this is the content of span, keleyi.com.<ahref= "Http://keleyi.com/a/bjac/2oncd079.htm">Original</a></span><BR/><BR/><ButtonID= "After_keleyi_com">After function</Button><BR/><BR/><ahref= "Http://keleyi.com/keleyi/phtml/jquery/13a.htm">Append function</a> <ahref= "Http://keleyi.com/keleyi/phtml/jquery/13b.htm">Appendto function</a><Scripttype= "Text/javascript">$("#after_ke"+"leyi_com"). Click (function () {$("span"). After ('<a href= "Http://keley'+'i.com "class=" A_kel'+'eyi_com "> This is the after function plus go to the content </a>')})</Script></Body></HTML>
The results are as follows:
<span class= "yuanlai_keleyi_com" > Collayi, this is the content of span, keleyi.com. <a href= "http://keleyi.com/a/bjac/2oncd079.htm" > Original </a></span><a href= "http://keleyi.com" class= "A_keleyi_com" > This is the after function plus go to the content </a>
That is, the span tag has more than one a label behind it.
2. Append function
Definition and Usage:
The Append () method inserts the specified content at the end of the selected element (still inside). Reference: http://keleyi.com/a/bjac/0vpch15n.htm
Grammar:
$ (selector). Append (content)
Instance Effect experience: http://keleyi.com/keleyi/phtml/jquery/13a.htm
Instance code:
<HTML><Head><title>The Append function instance of jquery-Ke Keeper</title><BaseTarget= "_blank" /><Scripttype= "Text/javascript"src= "Http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></Script><style>. yuanlai_keleyi_com{Border:1px solid Black;padding:5px}. a_keleyi_com{Color:Blue;}a{Color:Blue}</style></Head><Body><BR/><spanclass= "Yuanlai_keleyi_com">Collayi, this is the content of span, keleyi.com.<ahref= "Http://keleyi.com/a/bjac/2oncd079.htm">Original</a>。</span><BR/><BR/><ButtonID= "After_keleyi_com">Append function</Button><BR/><BR/><ahref= "Http://keleyi.com/keleyi/phtml/jquery/13.htm">After function</a> <ahref= "Http://keleyi.com/keleyi/phtml/jquery/13b.htm">Appendto function</a><Scripttype= "Text/javascript">$("#after_ke" + "leyi_com"). Click (function () {$(". Yuanlai_ke"+"leyi_com"). Append ('<a href= "Http://keley' + 'i.com "class=" A_kel' + 'eyi_com "> This is the Append function plus go to the content </a>')})</Script></Body></HTML>
The results are as follows:
<span class= "yuanlai_keleyi_com" > Collayi, this is the content of span, keleyi.com. <a href= "http://keleyi.com/a/bjac/2oncd079.htm" > Original </a><a href= "http://keleyi.com" class= "A_keleyi_ Com "> This is the after function plus go to the content </a></span>
That is, the span tag has one more a tag inside it.
3. Appendto function
Definition and Usage:
The AppendTo () method inserts the specified content at the end of the selected element (still inside). Reference: http://keleyi.com/a/bjac/opnw2awa.htm
Grammar:
$ (content). AppendTo (selector)
Instance Effect experience: http://keleyi.com/keleyi/phtml/jquery/13b.htm
Instance code:
<HTML><Head><title>The Appendto function instance of jquery-Ke Keeper</title><BaseTarget= "_blank" /><Scripttype= "Text/javascript"src= "Http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></Script><style>. yuanlai_keleyi_com{Border:1px solid Black;padding:5px}a{Color:Blue}. a_keleyi_com{Color:Blue;}</style></Head><Body><BR/><spanclass= "Yuanlai_keleyi_com">Collayi, this is the content of span, keleyi.com.<ahref= "Http://keleyi.com/a/bjac/2oncd079.htm">Original</a>。</span><BR/><BR/><ButtonID= "After_keleyi_com">Appendto function</Button><BR/><BR/><ahref= "Http://keleyi.com/keleyi/phtml/jquery/13a.htm">Append function</a> <ahref= "Http://keleyi.com/keleyi/phtml/jquery/13.htm">After function</a> <Scripttype= "Text/javascript">$("#after_ke" + "leyi_com"). Click (function () {$('<a href= "Http://keley' + 'i.com "class=" A_kel' + 'eyi_com "> This is the Appendto function plus go to the content </a>'). AppendTo (". Yuanlai_k" + "eleyi_com")//the notation is incorrect: $ (". Yuanlai_k" + "eleyi_com"). AppendTo (' <a href= ' Http://keley ' + ' i.com ' class= ' a_kel ' + ' eyi_com ' > This is the Appendto function plus go to the content </a> ')})</Script></Body></HTML>
The results are as follows:
<span class= "yuanlai_keleyi_com" > Collayi, this is the content of span, keleyi.com. <a href= "http://keleyi.com/a/bjac/2oncd079.htm" > Original </a><a href= "http://keleyi.com" class= "A_keleyi_ Com "> This is the after function plus go to the content </a></span>
That is, the span tag has one more a tag inside it.
The effect is the same as the APPEND function, except that they are written in the opposite way.
A practical application of the Appendto function: http://keleyi.com/a/bjac/jp71q5jt.htm
Original: http://keleyi.com/a/bjac/2oncd079.htm