Solved

Hide Div with Jquery

Posted on 2008-10-30
2
633 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
Comment Utility
try:
$(".divoptions").each(function(){$(this).hide()});
$("#divId").show();
0
 

Assisted Solution

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now