<script><br> $(function(){<br> var show_count = 20; //The number of items to be displayed<br> var count = $(" input:text").val(); //The starting value of the increment, here is your ID<br> var fin_count = parseInt(count) (show_count-1); //The conditions for ending the increment<br>
<p> $("#btn_addtr").click(function(){<br> if(count < fin_count) //When clicking, if the current number is less than the condition for the end of increment <br> {<br> $( "tr:eq(1)").clone().appendTo("table"); //Add a row after the table<br> $("tr:last td input:first").val( count); / /Change the ID value of the added row <br> }<br> });<br> });</p>
<p> function deltr(){<br> var length=$("tr").length;<br> if(length<=2){<br> alert("Keep at least one line");<br> } else{<br> $("tr:last").remove();<br> }<br> }<br></script>
ID
Username
Usertype
Other
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn