jQuery의 클론 기능(붙여넣기) 예

1567 단어 htmljquery
jQuery("#copy").click(function(){
 				var clipboardDate_ = window.clipboardData.getData("Text");
               	clipboardDate_ = clipboardDate_.split("
"); for (var i = 0; i < clipboardDate_.length; i++) { var resultDate = clipboardDate_[i].split(" "); if (resultDate.length == 7) { var sum3 = 0; $clone =jQuery("#row1").clone(true); jQuery('p').before($clone); $clone.find("input[type='text']").val(''); $clone.find("input[name='busiActName']").val(resultDate[0]); $clone.find("input[name='busiActCode']").val(resultDate[1]); $clone.find("input[name='proBdgtSubjName']").val(resultDate[2]); $clone.find("input[name='proBdgtSubjCode']").val(resultDate[3]); $clone.find("input[name='amount']").val(resultDate[4]); $clone.find("input[name='price']").val(resultDate[5]); $clone.find("input[name='bdgtSum']").val(resultDate[6]); } } jQuery("input[name='bdgtSum']").each(function(){ sum3=sum3+Number(jQuery(this).removeFormat())*100; }); jQuery("#costcount").html(commafy(sum3/100)); });

좋은 웹페이지 즐겨찾기