I want to insert a div element after a given element. How do I do it ONCE ?
This is what I have:
var i = 1;
$('<div id="plussign"></div>').one("insertAfter","#div" + i);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.one()is the same thing as.click()except it works only once and then detaches itself.You probably want to do this:
Do note that I changed your
idto aclass.ids are unique and there cannot be two elements with the sameidin the document.class, on the other hand, is not unique and can be used to group many elements together.