I have a div. After a click on a word, the div gets some spans. The Code:
<div id="show-data">
<span>Erprobung</span>
<span>Probe</span>
<span>Prüfung</span>
<span>Test</span>
</div>
My problem: I want to click on the new span-tags too, but it doesn't work for me. Here is my code:
$('$data-show').on('mouseover','span',function(){
alert("Test");
});
<div id="show-data"></div>
What is the solution to this issue? Thank you very much.
Use
#show-datainstead of$data-showandclick()event instead ofmouseover()event.