jQuery डालने के बाद () विधि
❮ jQuery के एचटीएमएल/सीएसएस तरीके
उदाहरण
प्रत्येक <p> तत्व के बाद एक <span> तत्व डालें:
$("button").click(function(){
$("<span>Hello world!</span>").insertAfter("p");
});
परिभाषा और उपयोग
इन्सर्टआफ्टर () विधि चयनित तत्वों के बाद HTML तत्वों को सम्मिलित करती है।
युक्ति: चयनित तत्वों से पहले HTML तत्वों को सम्मिलित करने के लिए, सम्मिलित करें () विधि का उपयोग करें।
वाक्य - विन्यास
$(content).insertAfter(selector)
Parameter | Description |
---|---|
content | Required. Specifies the content to insert (must contain HTML tags). Note: If content is an existing element, it will be moved from its current position, and inserted after the selected elements. |
selector | Required. Specifies where to insert the content |
इसे स्वयं आज़माएं - उदाहरण
प्रत्येक चयनित तत्व के बाद मौजूदा तत्व सम्मिलित करने के लिए insertAfter() विधि का उपयोग कैसे करें।
❮ jQuery के एचटीएमएल/सीएसएस तरीके