jQuery after() Metode
Voorbeeld
Voeg inhoud na elke <p>-element in:
$("button").click(function(){
$("p").after("<p>Hello world!</p>");
});
Definisie en gebruik
Die after()-metode voeg gespesifiseerde inhoud in na die geselekteerde elemente.
Wenk: Om inhoud voor geselekteerde elemente in te voeg, gebruik die before() metode.
Sintaksis
$(selector).after(content,function(index))
Parameter | Description |
---|---|
content | Required. Specifies the content to insert (can contain HTML tags)
Possible values:
|
function(index) | Specifies a function that returns the content to insert
|
Probeer dit self - voorbeelde
Voeg inhoud in met die after() metode.
Hoe om 'n funksie te gebruik om inhoud na geselekteerde elemente in te voeg.