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 AJAX Basics (retiring) jQuery and AJAX Introducing jQuery

Ben Ahlander
Ben Ahlander
7,528 Points

why is the button not hiding?

<!DOCTYPE html>
  <meta charset="utf-8">
  <title>AJAX with JavaScript</title>
  <link href='http://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css">
  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>


  function sendAJAX() {


  <div class="grid-container centered">
    <div class="grid-100">
      <div class="contained">
        <div class="grid-100">
          <div class="heading">
            <h1>Bring on the AJAX</h1>
          <button id="load" onclick="sendAJAX()" class="button">Bring it!</button>
          <div id="ajax">


3 Answers

Arien Woodrow
Arien Woodrow
7,222 Points

The button's id is load not ajax so $('#load').hide();

6,762 Points

The id of button is "load" instead of "ajax".

 $('#ajax').hide();  //change it to "load"


try to put it in a click function like this $( "ajax" ).click(function() { $( this ).hide(); });

Hope this helps : )