How to remove attribute with Haste

102 Views Asked by At

Module Haste.DOM contains function setAttr for setting attribute of HTML-element:

setAttr (fromJust createProfileButton) "form" "registerNewUserForm"

It works fine, but how can I remove attribute? For example, I have a button with attribute disabled and I want to make it enable. I try:

setAttr (fromJust createProfileButton) "disabled" ""

but it just make this:

<button type=submit ... disabled="">

I understand that I must remove this attribute, but module Haste.DOM doesn't contain function removeAttr... So what can I do?

1

There are 1 best solutions below

0
Denis Shevchenko On

I found partial solution: I can disable/enable my button via Bootstrap-class, not via an attribute. So, disable:

setClass (fromJust createProfileButton) "disabled" True

and enable:

setClass (fromJust createProfileButton) "disabled" False

And it works fine. But what about removing an attribute? Is it possible with Haste?