Bhawna Malhotra Bhawna Malhotra - 6 months ago 10
jQuery Question

Adding property disabled not working

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?

Answer

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

Instead use

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