April 4, 2012
How do I make bootstrap table rows clickable?
Question by rjurney
I can hack this myself, but I think bootstrap has this capability.
Answer by Terry
Using jQuery it’s quite trivial. v2.0 uses the table
class on all tables.
$('.table > tr').click(function() {
// row was clicked
});
Answer by Starx
May be you are trying to attach a function when table rows are clicked.
var table = document.getElementById("tableId");
var rows = table.getElementsByTagName("tr");
for (i = 0; i < rows.length; i++) {
rows[i].onclick = functioname(); //call the function like this
}