Reputation: 107
Here is the code:
<tr class="active" aria-selected="true" data-row-id="3">
I am using: $("tr").removeClass("active"); to remove the "active" class which works perfectly but I also need to set aria-selected="true" to "false", this is for a data-table selection in a modal. Any help will be most helpful,
Thank you!
Upvotes: 1
Views: 360
Reputation: 107
Thank you I changed my code to:
$('#modalAdd').on('hidden.bs.modal', function (e) {
$(".active").attr("aria-selected","false");
$(".active").removeClass("active");
$(".select-box").attr("checked", false);
Upvotes: 1
Reputation: 115222
Use jQuery attr()
method to update element attribute.
$('tr').attr('aria-selected','false');
Upvotes: 4