Hi Pals,
I am new to Javascript coding. I know very little about it. I am writting widget for S60 5th edition device, N97 mini in particular.
In HTML page, I have table, I want to handle event for each row. How can I do it? Please advice.
Here is snap of code which I have written.
For row with "22" I want to raise a event when I touch on screen & for "33" also I want to raise event on touch.
--------------------Start-------------------
<html>
<head>
<script type="text/javascript">
function addRow(content,morecontent)
{
if (!document.getElementsByTagName) return;
tabBody=document.getElementsByTagName("TBODY").item(0);
row=document.createElement("TR");
cell1 = document.createElement("TD");
cell2 = document.createElement("TD");
textnode1=document.createTextNode(content);
textnode2=document.createTextNode(morecontent);
cell1.appendChild(textnode1);
cell2.appendChild(textnode2);
row.appendChild(cell1);
row.appendChild(cell2);
tabBody.appendChild(row);
}
</script>
</head>
<body>
<table border='1' id='mytable'>
<tbody>
<tr><td>22</td><td>222</td></tr>
<tr><td>33</td><td>333</td></tr>
</tbody>
</table>
<button onClick='addRow("123","456");return false;'>
Add Row</button>
</body>
</html>
----------------End----------------------------------------
Regards,

Reply With Quote

