I use a table to display elements, the onclick event on cell [0] should output (warn) data from cell [1] and cell [2].
I am not sure with which approach I could access them.
Here is my code so far
http://jsfiddle.net/5uua7eyx/3/
Maybe there is a way to use my variable input
HTML
<table id="items">
<tr>
<td onclick="ClickPic(this)">Picture0</td>
<td>Name0</td>
<td>Price0</td>
</tr>
<tr>
<td onclick="ClickPic(this)">Picture1</td>
<td>Name1</td>
<td>Price1</td>
</tr>
</table>
Js
function ClickPic(e) {
"use strict";
var input = e.target;
alert("Clicked!");
}
thank
source
share