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 use the checked property to determine if the checkbox is checked or not. Then you can get the value of the checkbox that raised the event using this. Try this:
checked
this
$("#getusb").change(function(){ $('.active-usb').text(this.checked ? $(this).val() : ''); }).change();