<textarea id="data"></textarea><br /> <button id="start">出力</button> <table class="table" id="table"> <thead> <tr> <td></td> </tr> </thead> <tbody> <tr> </tr> </tbody> </table> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script language="JavaScript"> $("#start").click(function(){ var str = $("#data").val(); //格納 var strList = str.split("\n"); //改行 $.each(strList,function(index,val){ $("#table").append( $("<tr></tr>").append($("<td>" + val + "<input type='button' value='削除'/></td>")) ); }); }); </script>
あなたの回答
tips
プレビュー