Local Weather: How to hide content when Geolocation is not permitted

I am having trouble with the else condition, in which the geolocation is not enabled. I am trying to hide my toggle button when the user clicks block when asked for geolocation. The problem can be found on codepen: https://codepen.io/Ag_Yog/pen/wqgzNE. I tried the following code:

else{
$(".b").hide();
}

Thanks for any help.