javascript - Disabling a Button -
i need trying make button disable after has been clicked, grateful , if need anymore information ask me, thanks! appreciated.
function addgame() { var side = $("#side").val(); var steamid = $("#steamid").val(); var amount = $("#amount").val(); var buttontext = document.getelementbyid('creategamebutton').innerhtml; if(buttontext=='are sure?') { $.ajax( { url: 'addgame.php', type: 'post', data: 'side=' + side + '&steamid=' + steamid + '&amount=' + amount, datatype: 'text', success: function (data) { document.getelementbyid('game-alert').innerhtml = data; $("#game-alert").fadein(); refreshgames(); document.getelementbyid('creategamebutton').innerhtml = 'create game'; } }); } if(buttontext=='create game') { document.getelementbyid('creategamebutton').innerhtml = 'are sure?'; } }
$( "#creategamebutton" ).prop( "disabled", true );
Comments
Post a Comment