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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:12:30+00:00 2026-06-05T14:12:30+00:00

<table border=2> <tr> <td class=here one=lorem two=ipsum> click </td> <td class=here one=aaa two=bbb> click

  • 0
<table border=2>
    <tr>
        <td class="here" one="lorem" two="ipsum"> click </td>
        <td class="here" one="aaa" two="bbb"> click </td>
    </tr>
</table>

$('.here').click(function(){
  $(this).html($(this).attr('one'));
})

http://jsfiddle.net/uzhru/

How can i modify this javascript for function toggle or other solution?
I would like – if i click on TD then this show me attribute one, and if i next click then this show me attribute two, next one, next two etc

  • 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-05T14:12:31+00:00Added an answer on June 5, 2026 at 2:12 pm

    ocanal’s answer works perfectly but I thought I’d add that this can also be done with toggle which when given two functions will switch between them for each click:

    $(".here").toggle(function() {
        $(this).html($(this).attr('one'));
    }, function() {
        $(this).html($(this).attr('two'));
    });
    

    http://jsfiddle.net/7pUS4/

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

Sidebar

Related Questions

I'm looking for a way to expand/collapse all table rows at one click. Here
This is a HTML email. I have two tables inside each other. One set
I have an html table <table border=0 width=100%> <tr class=headerbg> <th width=5%> No </th>
Here's my HTML Table format : <table width=580 height=217 border=0 cellpadding=0 cellspacing=0> <tr> <td
CSS table tr {border-bottom:1px solid #008999} HTML <table width=100% cellspacing=0 cellpadding=0> <thead> <tr> <th
I want to create a html table with a 1pt black outer border and
I have an HTML table with collapsed and adjacent borders and a standard border
I have the following HTML table: <table style=width: 100%;> <tr> <td class=title_bar_left_border></td> <td class=title_bar_middle></td>
So far, I'm doing this programmatically using VB.net/ASP.net: <table cellspacing=0 cellpadding=4 border=0 style=border- width:0px;width:100%;border-collapse:collapse;font-size:12px;>
Why is this table row 1px off? Here is the debugger break pic, xhtml,

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.