There are a few errors in your code. Here are the corrected lines:

  1. Line 10: Change item_id to data_id in var item_id = $(this).attr('data_id');

  2. Line 12: Change imgid.toString(); to imgid.join(",");

Here is the corrected code:

$(document).on('click', '.qmulimg', function() {

	var inputp = $(this);
	$(this).remove();		
	var imgid = [];
	
	inputp.closest('.qq_uploader').find('.qq_u_img').find('.qq_muti_img').each(function() {

		var data_id =  $(this).attr('data_id');
		imgid.push(data_id); 
	});
	var imgidlist = imgid.join(",");			
			
	inputp.closest('.qq_uploader').find('.q_uid_img').val(imgidlist);	
		  
});

Please note that this code assumes that you have the necessary HTML elements with the appropriate classes defined in your document

$documentonclick qmulimg function 	var inputp = $this;	$thisremove;			var imgid = ;		inputpclosestqq_uploaderfindqq_u_imgfindqq_muti_imgeachfunction 	var item_id = $thisattrdata_id;	imgidpushitem_id;

原文地址: https://www.cveoy.top/t/topic/iExC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录