LoginSignup
1
1

More than 5 years have passed since last update.

jQuery+CoffeeScriptでのクリックイベント時の引数の渡し方

Posted at

jQueryとCoffeeScriptならなんか格好良い書き方があるのかと思ったけど、生JSと対して変わらんのしかわからんかった。
とりあえずコードは以下のような感じ。

function.rb()->
$("element").click(->
  ((num) ->
    console.log num
    return
  )(123)
)

なんか良い書き方があったら教えて欲しい。

1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1