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

In the launch workspace, for JQuery basics, jQuery(".warning").hide(); does not work

I am working on the launch workspace, and did the coding 'jQuery(".warning").hide()', to hide the css selector, but it is not hidden, when it is fired.

12 Answers

Hi,

Make sure the jquery file is linked in your html code. make sure that the script src="app.js" /script is defined in your html code. Also make sure to define your jquery library

script src="https://code.jquery.com/jquery-2.2.3.js" /script

There could be other issues as well.

Hi Dylan,

All of the above is included, and it does not work, I have hidden it, still it showing.

Thanks,

Antonio

Hi Antonio,

Can you try $(".warning").hide(); ?

Also, make sure that you have a class on your html tags, something like:

<div class="warning">

<p> this is a warning </p>

</div>

Sometimes, also the browser caches jquery, make sure you hit refresh, at least a couple of times

Hi Dylan,

I think there is some other problem, even that does not work, taking all the contents out from the html file too, brings in the image, where the image shouldn't have come.

Thanks,

Antonio

There is something wrong with the html or css. That is unusual behavior. Are you sure you are linking the css correctly on the html file. Could you share the code with me ? Just launch the code in workspace window and at the top right, you will see "Fork Workspace" ,click on that icon , change the name of the workspace and then copy the URL at the top of the window.

Hi,

I cannot access the link, it says "link not found" i think you closed the workspaces window. Can you keep the workspaces window open and then share the workspace with me?

Try now please.

My earlier instructions did not work. Can you please follow these instructions below to share the workspace,

1.Launch any of your workspaces. 2.Select the snapshot menu in the upper right corner. 3.Click "Take Snapshot"

  1. Visit the link and share it with someone.

The link URL should look something like this https://w.trhou.se/zbznfbg3sv

donno would this, depend on the computer locking too, by the way, snapshot link, https://w.trhou.se/4qey11ep8j

Hi Antonio,

I tried your code on my workspace and it works perfectly fine. The ".warning" has disappeared. Maybe, you have disabled javascript on your browser, Try opening the same workspace in different browsers like Firefox or IE or Chrome. Or make sure you have activated Javascript is working.

Check the followling link https://www.whatismybrowser.com/detect/is-javascript-enabled to see if your javascript is enabled.

Hi Dylan,

First of all, sorry for the late reply, this works like a charm for me, all these time, I was refreshing using the enter, and that had been the reason, not to show, with the effective changes. thank you very much.

Thanks,

Antonio