jquery - JavaScript Button disabled Value? -


is possible button disabled if bank balance small? example: bank balance = 3 , button bank balance = 5 <- button disabled

so need enough money button not disabled is!

i hope understand mean , hope can me!

my button :

<button type="sumbit" name='einzahlen' class="btn btn-info btn-block btn-md">pin einlösen</button> 

check simple code in jquery, hope helps you!

$(document).ready(function(){      $('#chk').click(function(){          var bal = parsefloat ($('.balance').text());          if(bal <= 50){  	   $('#btn').attr('disabled','disabled');          }      });  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <button type="sumbit" name='einzahlen' class="btn btn-info btn-block btn-md" id="btn">pin einlösen</button>  <button id="chk">check balance</button>  <span>balance: </span><span class="balance">50</span>


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -