JavaScript: Prepend element to DOM and inherit event handler
问题 I have a <textarea> and a <button> inside of a <form> . When submitted, I call e.preventDefault() and submit the form via AJAX . From there I return the query and PREPEND at information inside of a <div> at the top of this list. Also, I have given each item the ability to be deleted, which is instant on the client side but also submits a form via AJAX to be completely removed. This is sort of working. I am able to: Have a blank screen (no items added), create one and delete it no problems