1

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?

Denis Shevchenko
  • 1,342
  • 2
  • 10
  • 23

1 Answers1

1

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?

Denis Shevchenko
  • 1,342
  • 2
  • 10
  • 23