I\'m using a jQuery function to get the value of an checked checkbox.
How to hide the value in the span class \"active-usb\" if the checkbox is not checked anymore?
You can try something like this :-
$("#getusb").change(function(){ if($(this).is(':checked')){ $('.active-usb').text($(this).val()); } else{ $('.active-usb').text(''); } }).change();
OR
$("#getusb").change(function(){ $('.active-usb').text($(this).is(':checked') ? $(this).val() : ''); }).change();