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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -