• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

Hide Div with Jquery

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
JonMny
Asked:
JonMny
2 Solutions
 
hieloCommented:
try:
$(".divoptions").each(function(){$(this).hide()});
$("#divId").show();
0
 
Gomez1234Commented:
or little bit shorter:
$(".divoptions").hide();
$("#divId").show();
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now