This is my first Coffeescript function and can’t figure out how to get this to not refresh my page after the user clicks and the event is fired:
jQuery ->
$(".answer_link").click ->
$val = $(this).attr 'id'
$id = $val.replace(/answer_link_/, '')
$input = "#new_answer_" + $id
$($input).toggle 'slow'
Thanks!
I think this is a question about
jQueryorJavaScript.you can use
.preventDefault()to do this:more info about preventDefault.