I have the following code to show and hide content, but it only works once. When I click again to hide, nothing happens.
$(document).ready(function() {
$('li[name=music]').off().on('click', function() {
if ($(this).children().css('display', 'none')) {
$(this).children().css('display', 'block');
} else {
$(this).children().css('display', 'none');
};
});
});