I have created a tab and append some text in it
$("#tabcontent").append('<p id="c'+count+'"><table> <tr>Tab Content '+count+'<br><span id="addColumns" style="cursor:pointer;">Add Columns</span></p>');
there is an id addColumns I write a function for this id
$('#addColumns').click(function(){
$("#tabcontent").html('');
});
When I click on Add Columns Nothing is happening…
Your table is not in DOM when page loaded, so this is future element that’s why it’s not working. you have to use
.live()or as per jQuery 1.7
use
.on