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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:42:51+00:00 2026-05-20T05:42:51+00:00

I have an html table like below +——-+——-+——-+——-+——-+———+———+———+———+ | col1 | col2 | col3

  • 0

I have an html table like below

+-------+-------+-------+-------+-------+---------+---------+---------+---------+
| col1  | col2  | col3  | col4  | col5  | col6    | col7    | col8    | col9    |
+-------+-------+-------+-------+-------+---------+---------+---------+---------+
| data1 | data2 | data3 | data4 | data5 | button1 | button2 | button3 | button4 |
+-------+---------------+-------+-------+---------+---------+---------+---------+
| data6 | data7 | data8 | data9 | data0 | button1 | button2 | button3 | button4 |
+---------------+-------+-------+-------+---------+---------+---------+---------+

columns 6-9 contains buttons with corresponding names and ids as shown.

What I want is,

When the user click but 1 in row 1, the page should go to a url www.example.com/sample.php?but1=data1 and when the user click but 1 in row 2, the page should go to a url www.example.com/sample.php?but1=data6.
similarly, the buttons 2, 3 and 4 should redirect the page to www.example.com/sample2.php?but1=data1, www.example.com/sample3.php?but1=data1, www.example.com/sample4.php?but1=data1 in row 1 and www.example.com/sample2.php?but1=data6, www.example.com/sample3.php?but1=data6, and www.example.com/sample4.php?but1=data6 in row 2.

How can I make this possible using jquery??

The table contains more rows than shown here..

Here is my table

<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<table style="width: 100%" id="mytable" name="mytable">
    <tr>
        <td>col1</td>
        <td>col2</td>
        <td>col3</td>
        <td>col4</td>
        <td>col5</td>
        <td>col6</td>
        <td>col7</td>
        <td>col8</td>
        <td>col9</td>
    </tr>
    <tr>
        <td name="datacol" id="datacol">data1</td>
        <td>data2</td>
        <td>data3</td>
        <td>data4</td>
        <td>data5</td>
        <td id="data1" class="button1" name="button1" style="cursor:pointer">button1</td>
        <td id="data1" class="button2" name="button2" style="cursor:pointer">button2</td>
        <td id="data1" class="button3" name="button3" style="cursor:pointer">button3</td>
        <td id="data1" class="button4" name="button4" style="cursor:pointer">button4</td>
    </tr>
    <tr>
        <td name="datacol" id="datacol">data6</td>
        <td>data7</td>
        <td>data8</td>
        <td>data9</td>
        <td>data10</td>
        <td id="data6" class="button1" name="button1" style="cursor:pointer">button1</td>
        <td id="data6" class="button2" name="button2" style="cursor:pointer">button2</td>
        <td id="data6" class="button3" name="button3" style="cursor:pointer">button3</td>
        <td id="data6" class="button4" name="button4" style="cursor:pointer">button4</td>
    </tr>
</table>

the button cells are modified table ells with pointer cursor 😉

the url distribution should be like;

first row
button1: www.example.com/1111.php?aa=data1
button2: www.example2.com/2222.php?bb=data1
button3: www.example3.com/3333.php?cc=data1
button4: www.example4.com/4444.php?dd=data1

second row
button1: www.example.com/1111.php?aa=data6
button2: www.example2.com/2222.php?bb=data6
button3: www.example3.com/3333.php?cc=data6
button4: www.example4.com/4444.php?dd=data6

I need a code like this;

    <script type="text/javascript">
    $(function() {
        $('.button1').click(function() {
   document.location.href='the_link_to_go_to.html';  
        });
        $('.button2').click(function() {
   document.location.href='the_link_to_go_to.html';    
        });
        $('.button3').click(function() {
   document.location.href='the_link_to_go_to.html';     
        });
        $('.button4').click(function() {
   document.location.href='the_link_to_go_to.html';     
        });
    });
    </script>

Thanks in advance.. 🙂

blasteralfred

  • 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-20T05:42:52+00:00Added an answer on May 20, 2026 at 5:42 am

    Finally I solved it..
    First of all I thank Vivek, Prescott, JustcallmeDrago, BiAiB and Gordon… 🙂 Thanks guyz..

    I made it through

    <script type="text/javascript">
    $(function() {
        $('.button1').click(function() {
       window.location = "www.example.com/1111.php?aa=" + this.id;
        });
        $('.button2').click(function() {
       window.location = "www.example2.com/2222.php?bb=" + this.id;
        });
        $('.button3').click(function() {
       window.location = "www.example3.com/3333.php?cc=" + this.id;
        });
        $('.button4').click(function() {
       window.location = "www.example4.com/4444.php?dd=" + this.id;
        });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML table like below: ColA ColB ColC ColD ColE ColF Checked
I have a table setup like below: <table> <tr> <td class=url> <a href=http://www.domainname.com/page1.html />
I have an HTML table that looks like this: ------------------------------------------------- |Column 1 |Column 2
I have a table like this below. And there is a div container with
I have an html table followed by a button that says Add Row below
I have an HTML file (from Newegg) and their HTML is organized like below.
Consider I have a table, like below, that I am trying to populate with
I have an html table <table border=0 width=100%> <tr class=headerbg> <th width=5%> No </th>
I have an html table which i bind data dynamically on the server side
I have an HTML table with several columns and I need to implement a

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.