Good day.
I try to write a plugin on for jquery, which would find specially marked divs and insert html-code into them. Freshly created elements must respond to the click event:
$('button[data-type="site"]').bind("click", function (e) {console.log(e,$(this));}); On the page there are 2 elements that are processed by the plugin:
$('div[data-type="placeholder"]').myPlugin(); The strangeness (for me) is that when I click on the first button, I get 2 console.log outputs in the console, and when I click on the second button, I get one (which is the right behavior).
Why is the call to the event handler function called?
Example here http://test.controlcash.ru/b.php