Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Not working correctly in Chrome, works fine with Edge

I ran the workspace with chrome many times, check for syntax errors and spelling errors , even made sure JavaScript was on. Still nothing. Ran it with Edge an everything works as expected. Can anyone tell me what's going on ?

I went to stack overflow, and only found syntax errors.

$("#imageGallery a").click(function(event){
  event.preventDefault();
  var href = $(this).attr("href");
  console.log(href);
});

event.preventDefault();

No, I read that one before. I am trying to prevent the browser from following the link , its an exercise in the jquery basics lessons.