💥 2026 New Year's Sale 💥 Take 50% off your first 6 months! (new subscribers only, renews at regular price).

Join the Treehouse affiliate program and earn 25% recurring commission!

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Egor Banshchikov
    Egor Banshchikov
    4,736 Points

    "Task 1 is no longer passing" after I complete Task 2

    Posted July 12, 2016 5:59pm by Egor Banshchikov
    Egor Banshchikov
    4,736 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    1 Answer

  • Juan Pino
    Juan Pino
    25,107 Points

    On line 6 in the app.js file, prevent the browser's default behavior by calling the method we used on the event object.

    Posted May 6, 2016 1:12am by Juan Pino
    Juan Pino
    25,107 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    1 Answer

  • J V
    J V
    5,519 Points

    On line 7, set href to be the value of the href attribute of the clicked link?

    Posted February 10, 2016 9:14pm by J V
    J V
    5,519 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    2 Answers

  • Werner Chao
    PLUS
    Werner Chao
    Courses Plus Student 1,951 Points

    Difference between ID and class

    Posted January 13, 2016 12:20pm by Werner Chao
    Werner Chao
    Courses Plus Student 1,951 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    2 Answers

  • Francis N
    Francis N
    10,376 Points

    The instructions should be "line 8" because you added an event.preventDefault(); in previous challenge task on "line 7".

    Posted December 10, 2015 8:10pm by Francis N
    Francis N
    10,376 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    1 Answer

  • Garvit Sharma
    Garvit Sharma
    2,683 Points

    how to call defaultprevent??

    Posted August 7, 2015 10:05am by Garvit Sharma
    Garvit Sharma
    2,683 Points
    • CSS
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    2 Answers

  • MUZ140817 David Mvumira
    MUZ140817 David Mvumira
    5,233 Points

    On line 6 in the app.js file, prevent the browser's default behavior by calling the method we used on the event object.

    Posted June 22, 2015 11:18am by MUZ140817 David Mvumira
    MUZ140817 David Mvumira
    5,233 Points
    • CSS
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    4 Answers

  • Rachel Alexander
    Rachel Alexander
    4,425 Points

    jQuery lightbox code challenge

    Posted June 16, 2014 3:34am by Rachel Alexander
    Rachel Alexander
    4,425 Points
    • JavaScript
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    2 Answers

  • Xander Taylor
    Xander Taylor
    12,390 Points

    Can't get answer right, question 2 of 2

    Posted April 21, 2014 11:46pm by Xander Taylor
    Xander Taylor
    12,390 Points
    • HTML
    • jQuery Basics (2014)
    • Creating a Simple Lightbox
    • Preventing the Default Behavior and Using attr()

    3 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2026 Treehouse Island, Inc.