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
  • 65,304
  • 15
  • 70
  • 95
Morgan Allen
  • 3,065
  • 5
  • 50
  • 81

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
  • 65,304
  • 15
  • 70
  • 95
0

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

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

Brian
  • 3,701
  • 16
  • 26