How can I programmatically check a checkbox in Coffeescript ?
I know in Javascript, I can use this :
myElement.checked = true
Can I do something like the following in Coffeescript ?
myElement.checked "true"
I have already tried the above but it isn't working for me.
Any help in this regard will be highly appreciated. Thanks.
UPDATE:
So, for your case,
a.checked = b.checked; //i.e. check a if b is checked
Example here
Compiles to..
However,
a.b 10
compiles toa.b(10)
in javascript, which is not what you want. :)Your
myElement
is jQuery object and you want to address DOM element: