I am creating a button using javascipt like below:
"<div class='row'><button id='rkeys'>Related<button></div></div>"
$('#search_results').append(html_result)
And below that I have the functions which is waiting for a click event on '#rkeys' id, but nothing happens when I press that button.
related_keys = ->
console.log('click')
$('#rkeys').on 'click', related_keys
What can I do to make this work.