Here is the code to add event
$(document).on({ click: function() { $(this).hide(); $(\'#form_name\').removeClass(\'hide\');
You can try with:
var clickEvent = function() { $(this).hide(); $('#form_name').removeClass('hide'); $('#form_template_name') .attr('placeholder', $(this).text()) .focus(); }; $(document).on({ click: clickEvent }, '.form-template-name');
And unbind it with:
$(document).unbind('click', clickEvent);