How can I dynamically add a CSS class to a snippet of code when a radio button is selected?
Here's the jQuery Snippet:
$(document).ready(function (){
$("input:radio").click(function () {
if ($(this).is(":checked")) {
var empid = $(this).closest("tr").find("td:eq(0)").text();
$("#getreco").val(empid);
var empname = $(this).closest("tr").find("td:eq(1)").text();
$("#getreco1").val(empname);
var empdes = $(this).closest("tr").find("td:eq(2)").text();
$("#getreco2").val(empdes);
}
});
});