1

I'm using .val() to enter some data into a text box. However, when I go to click "add" I see that there is a disabled tag.

<input class="btn-primary action-submit" type="submit" value="Add" disabled="">

When I manually type in text, it disappears.

<input class="btn-primary action-submit" type="submit" value="Add">

Is there a way to remove it?

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
Morgan Allen
  • 3,291
  • 8
  • 62
  • 86

2 Answers2

1

I'm not sure what exactly you want, but to remove attribute you could use Element.removeAttribute() method:

document.querySelector('.action-submit').removeAttribute('disabled');
//or
document.getElementsByClassName("action-submit")[0].removeAttribute('disabled');

Hope this helps.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
0

To remove the disabled property with jQuery you would use this:

$('.action-submit').removeProp('disabled');

bcr
  • 3,791
  • 18
  • 28