J
Jesse Wade
Hello all. In N6+ is it possible to have a whole bunch of TD cells
in a table and have a click event handler on the TABLE object that identifies
the clicked cell?
I don't want to have individual click handlers on each TD as the page
will become too large.
So the concept would be something like:
<SCRIPT language="javascript">
function OnClick(E){
alert( some code that identifies the value of the clicked cell );
}
</SCRIPT>
<TABLE onclick="Onclick();">
<TR><TD>1</TD><TD>2</TD><TD>3</TD><TD>4</TD><TD>5</TD></TR>
<TR><TD>6</TD><TD>7</TD><TD>8</TD><TD>9</TD><TD>10</TD></TR>
<TR><TD>11</TD><TD>12</TD><TD>13</TD><TD>14</TD><TD>15</TD></TR>
<TR><TD>16</TD><TD>17</TD><TD>18</TD><TD>19</TD><TD>20</TD></TR>
<TR><TD>21</TD><TD>22</TD><TD>23</TD><TD>24</TD><TD>25</TD></TR>
<TR><TD>26</TD><TD>27</TD><TD>28</TD><TD>29</TD><TD>30</TD></TR>
<TR><TD>31</TD><TD>32</TD><TD>33</TD><TD>34</TD><TD>35</TD></TR> etc...
</TABLE>
in a table and have a click event handler on the TABLE object that identifies
the clicked cell?
I don't want to have individual click handlers on each TD as the page
will become too large.
So the concept would be something like:
<SCRIPT language="javascript">
function OnClick(E){
alert( some code that identifies the value of the clicked cell );
}
</SCRIPT>
<TABLE onclick="Onclick();">
<TR><TD>1</TD><TD>2</TD><TD>3</TD><TD>4</TD><TD>5</TD></TR>
<TR><TD>6</TD><TD>7</TD><TD>8</TD><TD>9</TD><TD>10</TD></TR>
<TR><TD>11</TD><TD>12</TD><TD>13</TD><TD>14</TD><TD>15</TD></TR>
<TR><TD>16</TD><TD>17</TD><TD>18</TD><TD>19</TD><TD>20</TD></TR>
<TR><TD>21</TD><TD>22</TD><TD>23</TD><TD>24</TD><TD>25</TD></TR>
<TR><TD>26</TD><TD>27</TD><TD>28</TD><TD>29</TD><TD>30</TD></TR>
<TR><TD>31</TD><TD>32</TD><TD>33</TD><TD>34</TD><TD>35</TD></TR> etc...
</TABLE>