I have an application in which I display a table(basically used to display errors) inside a popup, one of the tds have a button which is used to suppress this error. My problem is when used in conjuction with the smallipop plugin the click event is not getting fired , however it is running when run without the smallipop plugin. I have no clue whats going on here. I have fiddles for both the scenarios below:
HTML
<body>
<label>testing with smalipop</label>
<div class="myElement" id="test" style="width:100px;height:200px;background:blue">
</div>
</body>
JS
var table = document.createElement('table');
for (var i = 1; i < 4; i++){
var tr = document.createElement('tr');
var td1 = document.createElement('td');
var text1 = document.createTextNode('Text1');
var btn = document.createElement("BUTTON");
btn.className ="clickable";
var t = document.createTextNode("CLICK ME");
btn.appendChild(t);
btn.addEventListener( 'click', function ( e ) {
console.log('you clicked me');
}, false );
td1.appendChild(btn);
td1.appendChild(text1);
tr.appendChild(td1);
table.appendChild(tr);
}
var tooltipSpan = document.createElement('span');
tooltipSpan.className = "smallipop-hint";
tooltipSpan.appendChild(table);
$("#test").append(tooltipSpan);
$('.myElement').smallipop();
Fiddle with smallipop
http://jsfiddle.net/fdu9vtv0/8/
Fiddle without smallipop