I've got a very basic jquery code for adding a new class to an HTML element:
<script>
$('#sign-in').on('click', function() {$(this).toggleClass('display-none');
});
</script>
It adds the display-none
class to the div container with an id of #sign-in when it's clicked. However what I want is to add this class to a div with another id. How is that possible?
What I want finally:
<div id="sign-in"></div> <!-- The div to be clicked -->
<div id="new"></div> <!-- The div I need to add the .display-none class to when the previous div is clicked -->