I try make button with jQuery I call the JavaScript function, but I got problem :
- after page loaded, first time click on mybutton there is no reaction
- second click will execute function twice
- third click will execute function three and more
Why my code execute many more ? I just want " 1 click 1 execution JavaScript function" my code like this
<script type="text/javascript" language="javascript">
function showcase(){
var foo = function () {
alert('tutup');
};
$('#create-new').on('click',foo);
return false;
}</script> <button class="button" id="create-new"onclick="return showcase();">show text</button>
please help me out this problem
for try my full error code at here http://jsbin.com/ovucer/1/edit