Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "removeattr is not a function" exception

Tags:

jquery

I am using jquery-1.7.2.min.js

I'm getting TypeError:

$("#TextBox1").removeattr is not a function [Break On This Error]   
$("#TextBox1").removeattr("disabled"); 

Why?

like image 246
Rajamohan Anguchamy Avatar asked Feb 03 '26 12:02

Rajamohan Anguchamy


1 Answers

The correct function name is removeAttr(), not removeattr:

$("#TextBox1").removeAttr("disabled");

But starting from jQuery 1.6 it's better to use the .prop() method for setting native attributes such as disabled and checked:

$('#TextBox1').prop('disabled', false);
like image 186
Darin Dimitrov Avatar answered Feb 05 '26 02:02

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!