57
rated 0 times
[
63]
[
6]
/ answers: 1 / hits: 15803
/ 11 Years ago, thu, august 29, 2013, 12:00:00
I have an HTML table that has a button on every row. The objective here is when a button is clicked, the whole row will got the background color changed.
The code is:
<table>
<tr>
<td>Value1</td>
<td>Value2</td>
<td>
<input type=button value=press onclick=myFunction(this) />
</td>
</tr>
<tr>
<td>Value3</td>
<td>Value4</td>
<td>
<input type=button value=press onclick=myFunction(this) />
</td>
</tr>
</table>
<script type=text/javascript>
function myFunction(e) {
//change the background color of the row
}
</script>
Can you help me with this? Thanks!
More From » jquery