Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 502931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:20:32+00:00 2026-05-13T06:20:32+00:00

I need to hide all the tags which has the ID ‘media’ E.g.: `<div

  • 0

I need to hide all the tags which has the ID ‘media’

E.g.:

`<div id='media'>contents</div>`

`<div id='media'>content</div>`

How to do this using JavaScript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:20:32+00:00Added an answer on May 13, 2026 at 6:20 am

    WOAH slow down there for a second buddy!

    ID = IDENTIFIER = UNIQUE

    You can only use id’s once #id

    CLASS = CATEGORY/GROUP = NOT UNIQUE

    You can use classes everywhere .class as many times as you’d like.

    Don’t make classes named .id, that’s silly.
    Don’t make an id named #class, as that is also silly.

    document.getElementByClassName(“class”).style.display = ‘none’;

    That’ll do it.

    Apparently no it won’t, read this SO Question about the problem.


    jQuery Implementation

    Note: All the below examples assume that .hidden is defined in a css file like so:

    .hidden {
        display: none;
    }
    

    Hiding Stuff

    to hide something by id:

    $("#id").addClass("hidden");
    

    to hide something by class:

    $(".class").addClass("hidden");
    

    to hide everything inside of something:

    $("#specificSomething *").addClass("hidden");
    

    to hide everything of class bacon within the id stomach:

    $("#stomach .bacon").addClass("hidden");
    

    Showing Stuff

    to show everything that is hidden:

    $(".hidden").removeClass("hidden");
    

    to show everything that is hidden inside of something:

    $("#specificSomething .hidden").removeClass("hidden);
    

    Don’t forget!

    You can also use the built in functions, show() and hide(), like so:

    $("#specificsomething").hide();
    
    $("#specificsomething").show();
    

    They also have some fancyness built in, like basic animation. Refer to the documentation to use those.

    It’s best not to mix and match both of these methods, you can easily confuse yourself and waste plenty of time chasing silly mistakes.


    Don’t limit yourself!

    If you’re new to or unfamiliar with jQuery, don’t forget that you can do things like:

    • Hide anything with a specific color.
    • Check to see if the first letter of a <p> is a vowel, and hide the entire <p>.
    • Hide all the vowels, everywhere, ever.
    • Hide anything that the user clicks on (when elaborately animated, is quite fun).

    These are just a few (admittedly silly) examples of the magic jQuery is capable of. There’s a whole book full of new and crazy ways to do things. It’s called the documentation. Don’t be afraid of it because it’s large and full of words. Dive in! There are examples for EVERYTHING. Try things just to try them, even if you don’t think they’ll work (you’ll be surprised).

    I’ll only give you the easiest of the five examples. I’ll likely come back to this later and stuff it with more awesomeness.

    Hide anything when the user clicks on it:

    $("*").click(function () { 
         $(this).slideUp(); 
    });
    

    Wisdom Alert!

    Remember, just because you aren’t
    doing it right, doesn’t mean you’re
    doing it wrong. Sometimes, you aren’t
    even doing it at all.

    Cheesy Pun Warning!

    Remember, it’s always better to stay
    classy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to hide phone numbers and other contact details in user generated content
I am using Qt Dialogs in one of my application. I need to hide/delete
Possible Duplicate: how to hide a div after some time period? i need to
I am trying to hide all the tags in html that are <input type=radio>
I need to hide() all class level elements of '.dd-container' except when that element
I want to hide all div's hide when clicked on the body of the
This question follows on from a previous question which can be found here: Need
I need to find (and hide) all links with images (.jpg, .png, .gif) in
I am using PHP FOX all the process was documented very well. But need
I am having problems showing divs where the div has three selectors I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.