[SOLVED] - Table attribute variable

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[SOLVED] - Table attribute variable

Post by anjanesh »

I have 2 <table>s.
Each of these tables is actually a progress bar status - like the windows type.

progress1
progress2

Both gets updated - when progress2 finishes, progress1 gets incremented by 1 and progress2 restarts....goes on until progress1 finishes.

Problem is I need separate counters to keep track of completion status for each table - Im setting the <td> colour value.
Instead of checking each one for where the colour is white so as to add from there on - these counters is a lot faster.

Is there any way for me to have some attribute in the table that I can use as a counter - I dont want to use separate JS variable for each bar.

Something like <table id="Bar1" sometagvalue="0">
so that I can do document.getElementById("Bar1").sometagvalue = "2";

Thanks
Last edited by anjanesh on Mon May 09, 2005 10:35 am, edited 1 time in total.
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post by wwwapu »

I guess you could use title for that. http://www.w3.org/TR/html4/struct/globa ... adef-title
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Ah..yes - thats a good one - thanks - wouldnt mind showing the title when a user moves the moves over the progress bar.
BTW, in IE if I just add some attribute like <table currentPos="0"> I can actually access currentPos in Javascript !!! If this had worked in FireFox and others then this would have been really cool ! - User-defined attributes !
Post Reply