I’m trying to add class “visible” to a div with the same ID as my link’s hrefs, which also has class “popup”. Here’s my code so far:
<a href="#about">Sample link</a>
<div id="#about" class="popup">Sample content</div>
<script>
$(document).ready(function(){
$("a").click(function(event){
event.preventDefault();
var id = $this.attr('href');
$('id.popup').addClass("visible");
});
});
</script>
I’ve tried many variations of the ID.popup combo but I can’t seem to get the targeting right.
Any help would be appreciated!
Thanks!
you need to fix these lines
to