JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></scr
</head>
<body style="font-size:62.5%;">
<div id="tabs">
<ul>
</ul>
</div>
<input type='button' id='addTab' value='Add Tab'>
<input type='button' id='appendText' value='Add Text in Tab'>
<table>
<thead>
<th>ID</th>
<th>Name</th>
</thead>
<tbody>
<tr id="thj">
<td>1</td>
<td>Kamal</td>
</tr>
</tbody>
</table>
<button type="button" onclick="abc()">abc</button>
</body>
</html>
SCSS
#addtab{
cursor:pointer;
}
JavaScript
$(document).ready(function() {
$("#tabs").tabs({
tabTemplate: "<li><a href='#{href}'>#{label}</a> <p title='close' id='removeTab' style='cursor:pointer;display:inline'>x</p></li>"
});
});
$(function() {
var index = 0;
$("#addTab").live('click', function() {
index++;
var title = 'Tab..... ' + index;
var url = '#fragment-' + index;
addTab(url, title, index);
$('li.ui-state-default:last').attr("id",index);
//alert($('li.ui-state-default').attr("id"));
});
function addTab(url, title, index) {
$('#tabs').tabs("add", url, title, [index]);
}
$('#removeTab').live('click', function() {
selected = $('p[id=removeTab]').index(this); // this line to add id
$('#tabs').tabs("remove", [selected]);
});
$('#appendText').live('click', function() {
$('#tabs .ui-tabs-panel').each(function(index) {
if(!($(this).hasClass('ui-tabs-hide'))){
//do the dew!
$(this).append("Bla Bla!!!");
}
});
});
});
function abc(){
alert('in');
}