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

  • Home
  • SEARCH
  • 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 842269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:55:55+00:00 2026-05-15T05:55:55+00:00

So I am trying to create an extension in Chrome (a prototype for a

  • 0

So I am trying to create an extension in Chrome (a prototype for a project that I am doing) that targets all of the <div> tags of any web page, hides them or rather doesn’t display them until the user clicks the mouse (further explained below). So typing a url into the browser yields a white page. The person clicks, and the first <div> appears (probably the mast head or menu). The user clicks again and the second <div> appears.

I have gotten to the point where I can hide or show all <div>‘s (the obvious easy part) but I am not sure how to go about targeting each since every website has different id’s for them while still using the <div> tag. This is what I need the most help with.

This is part of a grander operation called the Web Crank. It’s just a physical crank that controls the speed by which a web page loads. Each time you make one full rotation of the crank, one section (the first <div>) of the web page loads. The faster you go, the quicker the page loads.

I hope this is clear enough. I am a newbie when it comes to this, but I have done some minor coding in the past and it’s not such a big deal.

Thanks for your help!

  • 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-15T05:55:56+00:00Added an answer on May 15, 2026 at 5:55 am

    Using just the DOM without any libraries, iterate over this:

    document.getElementsByTagName("div")
    

    gets you all the <div>s on the page. To iterate over them, use a for loop:

    var divs = document.getElementsByTagName("div");
    for (var i = 0; i < divs.length; i++) {
      /* stuff */
    }
    

    In jQuery (which you probably ought not to use in a Chrome plugin…):

    $("div").each(function(i) { /* whatever */ });
    

    What you basically want to do is iterate through all the <div>s and hide them all, then as you crank the crank, have that call an iterator that goes through and adds things back in. Probably what I’d do is create a FIFO queue (like this?) of ‘to-be-cranked’ elements as you are hiding them, and then as the crank operation fires (however you do that), start pulling items off the queue and showing them again.

    As a side issue, why <div>s though and not just all block-level elements? You probably want to search for <div>, <p>, <blockquote>, <ol>, <ul>, <dl> and <table> elements too.

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

Sidebar

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.