0

I have to disable a button on click.Using below code but its not working. Below code is using jquery

$('#someid').prop('disabled', true); 

Any solution?

Bhawna Malhotra
  • 476
  • 5
  • 18

2 Answers2

1

Property and attribute have different behaviours. See here https://stackoverflow.com/a/6004028/4485651

Instead use

$('#someid').attr('disabled', true);
Community
  • 1
  • 1
1
$('#yourButton').click(function(){
    $(this).attr('disabled', true);
})
barbq
  • 11
  • 2