<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 increment, here is your ID <br>var fin_count = parseInt(count) (show_count-1); //Condition for ending increment <br>$("#btn_addtr").click(function(){ <br>if(count < fin_count ) //When clicked, if the current number is less than the increment end condition <br>{ <br>$("tr:eq(1)").clone().appendTo("table"); //After the table Add a row <br>$("tr:last td input:first").val( count); //Change the ID value of the added row <br>} <br>}); <br>}); <br>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>
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