javascript - Click handler not getting invoked after html write -


i've code:

 document.getelementbyid('form1').innerhtml = user_selections.stockyard_html[sel];   alert('click handler registered');  $("#" + register_btn_id).click(function (event){ alert("clicked"); }); 

after html overwrite of form html saved yesterday, there register button click i'm not able catch. reason?

put inside document ready:

$(function() {    $("#" + register_btn_id).on('click', function(e) {        alert('clicked')    )} }) 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -