JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://raw.github.com/twitter/bootstrap/2.0-wip/js/bootstrap-modal.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<table summary="Measure Information">
<thead>
<tr>
<th>Category</th>
<th>Description</th>
<th>Notes</th>
<th width="10%">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<select><option>AIR SEALING</option></select>
</td>
<td><select id="catmeasureId"><option>BLOWER DOOR SET UP</option></select></td>
<td>teting</td>
<td><a title="remove BLOWER DOOR SET UP" class="btn delete" href="www.espn.com">Remove</a></td>
</tr>
<tr>
<td>
<select><option>FOUNDATION INSULATION</option></select>
</td>
<td><select id="catmeasureId"><option>FIBERGLASS BATT-R19</option></select></td>
<td></td>
<td><a title="remove FIBERGLASS BATT-R19" class="btn delete" href="www.sportsline.com">Remove</a></td>
</tr>
<tr>
<td>
<select><option>DOOR REPLACEMENT</option></select>
</td>
<td><select id="catmeasureId"><option>DOOR REPLACEMENT</option></select></td>
<td>Yeah baby!</td>
<td><a title="remove DOOR REPLACEMENT" class="btn delete" href="www.foxsports.com">Remove</a></td>
</tr>
<tr>
<td>
<select name="category" id="category">
<option...
JavaScript
//anonymous function to grab all delete buttons and turn into a modal
(function(){
var delBtn = $(".delete"),
$modal = $("#modal-delete");
if(!$modal.size()){
$modal = $('<div id="modal-delete" class="modal hide fade"><div class="modal-header"> <a href="#" class="close">×</a><h3>Confirm Delete</h3></div><div class="modal-body" id="modal-content"></div><div class="modal-footer"> <a href="#" id="okButton" class="btn danger">OK</a> <a href="#" id="cancelButton" class="btn secondary">Cancel</a> </div></div>').appendTo("body");
}
delBtn.each(function(){
var $button = $(this),
clickHandler,
href= $button.attr("href");
if(href){
clickHandler = function(){
console.log(href);
//return window.location=href;
};
}
else{
clickHandler = $button.click;
}
$button.attr("data-toggle","modal").
attr("data-target","#modal-delete");
$button.on("click",function(){
$modal.find("#okButton").on("click",function(){
clickHandler();
$modal.modal('hide');
}).
end().
find("#cancelButton").on("click",function(){
$modal.modal('hide');
}).
end().
find("#modal-content").html($button.attr("title"));
});
});
})();