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 8294801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:21:07+00:00 2026-06-08T14:21:07+00:00

I have two html files namely FIRST.html and SECOND.html FIRST.html has DIVs with IDs

  • 0

I have two html files namely FIRST.html and SECOND.html

FIRST.html has DIVs with IDs A1 to A100, SECOND.html has DIVs with IDs B1 to B100

On clicking a particular DIV in FIRST.html, I want to redirect the user to SECOND.html and show the corresponding DIV.

For example, if a user clicks DIV id=A10 in FIRST.html, he should be redirected to SECOND.html and be shown the DIV id=B10.

I need thoughts on how this could be done, I would like to know if we could pass some parameters from one page to another and then call a javascript using those parameters.

Thank you!

  • 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-06-08T14:21:13+00:00Added an answer on June 8, 2026 at 2:21 pm

    You could try something like this:

    Add this to FIRST.html

    $(document).ready(function() {
        $('div').click(function () {
           id = $(this).attr('id').substring(1);
           window.location = 'SECOND.html?id=' + id;
        });
    
        var getVar = location.search.replace('?', '').split('=');
        $('div[id$=' + getVar[1] + ']')[0].scrollIntoView();
    });
    

    Add this to SECOND.html

    $(document).ready(function() {
        $('div').click(function () {
           id = $(this).attr('id').substring(1);
           window.location = 'FIRST.html?id=' + id;
        });
    
        var getVar = location.search.replace('?', '').split('=');
        $('div[id$=' + getVar[1] + ']')[0].scrollIntoView();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two plain html files. The first has a tree on the left
I have two files: master/newsletter1/file.html master/newsletter2/file.html newsletter1/file.html has a lot of new changes that
I have two html files namely file1.html and file2.html. File1 is supposed to encode
I'm using Jquery mobile framework. I have 2 html files which has two buttons
I have two html files information.html and employee.html. Information.html contains two tables having IDs
I have two PHP files: template.php template.html.php The first is the class definition for
I have three files in a folder 'test' one.php two.php print.html And i have
lets say i have two pages links.html & contents.php ... first page contains only
I have two web-sites and two files: provider.com/provide.js viewer.com/index.html viewer.com/index.html renders information to the
i have two files one called stats.js one called storage.html in stats.js in contains

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.