How can i give a limit to an append function with javascript?
问题 I have an append button which appends endlessly if you click it endlessly. Lets say i want this button to do this 10 times. Let me tell you in fantasy code :p what i was thinking so that i can learn from my mistakes; ( i know its wrong but hey im learning) thismany = 1; appendbutton.onClick = "thismany = +1"; if{ thismany = <9} appendbutton.onClick = disabled thanks in advance 回答1: (function(){ var count = 1; document.getElementById("the_node_id").onclick = function(){ if(count > 10){ return;