I’m using DataTables and have this code to highlight the rows selected:
/* Click event handler */
$('#items-table tbody tr').live('click', function () {
var id = this.id;
var index = jQuery.inArray(id, aSelected);
if ( index === -1 ) {
aSelected.push( id );
} else {
aSelected.splice( index, 1 );
}
$(this).toggleClass('row_selected');
} );
What I would like to do is only display the following html if one or more rows are selected:
<p>
<a href="javascript:void(0)" id="delete">Delete selected rows</a>
</p>
How can I achieve this?
1 Answer