Bonjour,
Je voulais aller vite en reccuperrant le code de Robert Nyman sur internet mais je suis bloquée là, au secours !
je me débrouille en CSS et HTML, mais suis complétement nulle en JavaScript, du coup je ne sais pas comment faire pour aller à une page après avoir cliqué sur un lien en sachant qu'il y a déjà une fonction JS qui est attachée à ce lien.

Je sais pas si je suis claire...

voici le code de mon tableau, les liens (mes boutons) se trouvent dans <tfoot>. A chaque bouton je voudrais attacher un URL diffèrent.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<title>sound squirt pricing table</title>
<style type="text/css">
 
 
a img {border:0;vertical-align:text-bottom;}
table {border-collapse:collapse;}
th.side {
	background: transparent url(images/bg_th_side.gif) no-repeat bottom left;
}
td.side {
	text-align:right;
	background: transparent url(images/bg_td_side.gif) no-repeat bottom left;
	width:165px;
	font:bold 12px/15px verdana;
	color:#666666;
	padding-right:12px;
}
 
td.side a, a:link, a:visited {
	height: auto; width:auto;
	text-align:right;
	font:bold 12px/15px verdana;
	color:#666666;
}
 
td.side a:hover{
	text-decoration: none;
	text-align:right;
	font:bold 12px/15px verdana;
	color:#666666;
}
 
td.side a:active, a:focus {
      outline: none;
}
 
tfoot a, a:link, a:visited {
	height: 27px; width:35px;
}
 
tfoot a:hover{
	text-decoration: none;
}
 
tfoot a:active, a:focus {
      outline: none;
}
 
 
.thtab {
font-size:11px;
}
th {
	height:55px;
	border-right:1px solid #3F8F41;
	border-bottom:2px solid #3F8F41;
	vertical-align:bottom;
	color:#fff;
	font:normal 19px arial;
	padding-bottom:5px;
	background:transparent url(images/bg_th.gif) no-repeat bottom left;
	}
td {
	text-align:center;
	background:transparent url(images/bg_td.gif) no-repeat bottom left;
	border-right:1px solid #3F8F41;
	color:#fff;
	width:92px;
	height:32px;
	font:bold 12px/18px verdana;
}
td.on {background:transparent url(images/bg_td_on.gif) no-repeat bottom left;}
th.on {
	background:transparent url(images/bg_th_on.gif) no-repeat bottom left;
	padding-bottom:8px;
	width:107px;
}
 
tfoot td {
	background:transparent url(images/bg_foot_td.gif) no-repeat top left;
	height:64px;
	vertical-align:top;
	padding-top:8px;
}
tfoot td.on {
	background:transparent url(images/bg_foot_td_on.gif) no-repeat top left;
	padding-top:12px;
}
tfoot td.side {background: transparent url(images/bg_foot_td_side.gif) no-repeat top left;}
 
 
 
</style>
 
<script type="text/javascript">
/*
	For functions getElementsByClassName, addClassName, and removeClassName
	Copyright Robert Nyman, http://www.robertnyman.com
	Free to use if this text is included
*/
function getElementsByClassName(className, tag, elm){
	var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
	var tag = tag || "*";
	var elm = elm || document;
	var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
	var returnElements = [];
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(testClass.test(current.className)){
			returnElements.push(current);
		}
	}
	return returnElements;
}
 
function addClassName(elm, className){
    var currentClass = elm.className;
    if(!new RegExp(("(^|\\s)" + className + "(\\s|$)"), "i").test(currentClass)){
        elm.className = currentClass + ((currentClass.length > 0)? " " : "") + className;
    }
    return elm.className;
}
 
function removeClassName(elm, className){
    var classToRemove = new RegExp(("(^|\\s)" + className + "(\\s|$)"), "i");
    elm.className = elm.className.replace(classToRemove, "").replace(/^\s+|\s+$/g, "");
    return elm.className;
}
 
function activateThisColumn(column) {
	var table = document.getElementById('pricetable');
 
	// first, remove the 'on' class from all other th's
	var ths = table.getElementsByTagName('th');
	for (var g=0; g<ths.length; g++) {
		removeClassName(ths[g], 'on');
	}
	// then, remove the 'on' class from all other td's
	var tds = table.getElementsByTagName('td');
	for (var m=0; m<tds.length; m++) {
		removeClassName(tds[m], 'on');
	}
 
	// now, add the class 'on' to the selected th
	var newths = getElementsByClassName(column, 'th', table);
	for (var h=0; h<newths.length; h++) {
		addClassName(newths[h], 'on');
	}
	// and finally, add the class 'on' to the selected td
	var newtds = getElementsByClassName(column, 'td', table);
	for (var i=0; i<newtds.length; i++) {
		addClassName(newtds[i], 'on');
	}
}
</script>
</head>
<body>
 
 
 
<table id="pricetable">
	<thead>
		<tr>
			<th class="side">&nbsp;</th>
			<th class="choiceA"><span class="thtab">à partir de</span><br>€ 539 ttc</th>
			<th class="choiceB"><span class="thtab">à partir de</span><br>€ 749 ttc</th>
			<th class="choiceC on"><span class="thtab">à partir de</span><br>€ 969 ttc</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<td class="side">&nbsp;</td>
			<td class="choiceA"><a href="#" onclick="activateThisColumn('choiceA');return false;"><img src="images/choisir_tr.png" alt="Choisir la formule" /></a></td>
			<td class="choiceB"><a href="#" onclick="activateThisColumn('choiceB');return false;"><img src="images/choisir_tr.png" alt="Choisir la formule" /></a></td>
			<td class="choiceC on"><a href="#" onclick="activateThisColumn('choiceC');return false;"><img src="images/choisir_tr.png" alt="Choisir la formule" /></a></td>
		</tr>
	</tfoot>
	<tbody>
		<tr>
			<td class="side"><a href="#" title="Voir les détails">Objet 1</a></td>
			<td class="choiceA">4,000</td>
			<td class="choiceB">400</td>
			<td class="choiceC on">40</td>
		</tr>
		<tr>
			<td class="side"><a href="#" title="Voir les détails">Objet 2</a></td>
			<td class="choiceA">3 zeros</td>
			<td class="choiceB">2 zeros</td>
			<td class="choiceC on">1 zero</td>
		</tr>
		<tr>
			<td class="side"><a href="#" title="Voir les détails">Objet 3</a></td>
			<td class="choiceA"><img src="images/check.png" alt="oui" /></td>
			<td class="choiceB"><img src="images/check.png" alt="oui" /></td>
			<td class="choiceC on"><img src="images/check.png" alt="oui" /></td>
		</tr>
		<tr>
			<td class="side"><a href="#" title="Voir les détails">Objet 4</a></td>
			<td class="choiceA"><img src="images/check.png" alt="oui" /></td>
			<td class="choiceB"><img src="images/check.png" alt="oui" /></td>
			<td class="choiceC on">&nbsp;</td>
		</tr>
	</tbody>
</table>
 
</body>
</html>