Reputation: 12102
I have the following code:
function toggleChecked(status) {
$(".checkbox").each( function() {
$(this).attr("checked",status);
})
}
I don't know how to change the each clause and anonymous function inside it.
Upvotes: 4
Views: 3024
Reputation: 149524
toggleChecked = (status) ->
$(".checkbox").each ->
$(this).attr "checked", status
Note that you can use Js2coffee to convert JavaScript into CoffeeScript.
Upvotes: 10