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.
toggleChecked = (status) ->
$(".checkbox").each ->
$(this).attr "checked", status
Note that you can use Js2coffee to convert JavaScript into CoffeeScript.