Home > Article > Backend Development > javascript - js upload problem
These small blocks are generated through the add button below. If it is a form, it is fine. Now I am in trouble.
The upload button is a plug-in written in js and must be rendered before it can be used. If it is appended using append, the button cannot be used. Yes, is there any way to solve it?
These small blocks are generated through the add button below. If it is a form, it is fine. Now I am in trouble.
The upload button is a plug-in written in js and must be rendered before it can be used. If it is appended using append, the button cannot be used. Yes, is there any way to solve it?
jquery on method:
<code>$("body").on("click", '上传按钮的id或类名', function(){ // 触发上传事件 });</code>
Using js to implement, the principle is to monitor the click event of the body, and trigger the event when event.traget is the target.
I actually don’t quite understand what you mean when you say that the upload button is a plug-in written in js. I temporarily think that clicking the button will call this plug-in. If not, please describe it in more detail.