题主的问题本质地是如何控制动态插入的新节点。用 jQuery 的话,可以这么来:
$(document).on('click', 'input', function() { alert(123456); });