Rajamohan Anguchamy
Rajamohan Anguchamy

Reputation: 1736

Getting "removeattr is not a function" exception

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?

Upvotes: 2

Views: 16576

Answers (3)

maniix
maniix

Reputation: 51

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

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

It is camelCase.

Upvotes: 0

Esh
Esh

Reputation: 856

try this

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

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1038850

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);

Upvotes: 9

Related Questions