Solved

Hide Div with Jquery

Posted on 2008-10-30
2
634 Views
Last Modified: 2012-05-05
I have some divs with a class of divoptions

I would like to hide all of the divs with that class and then show one based on ID

using Jquery

How do I do this?
0
Comment
Question by:JonMny
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 250 total points
ID: 22844385
try:
$(".divoptions").each(function(){$(this).hide()});
$("#divId").show();
0
 

Assisted Solution

by:Gomez1234
Gomez1234 earned 250 total points
ID: 22844410
or little bit shorter:
$(".divoptions").hide();
$("#divId").show();
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to hide html tags in text area 4 37
how can display objects ? 3 25
Check if Object property exists? 3 19
Detect change of Select using JavaScript Only 12 50
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now