can any one tell how please
here is the code with out a text box which is working
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <script type="text/javascript">
- function cell()
- {
- var x=document.getElementById('myTable').rows[0].cells;
- alert(x[0].innerHTML);
- }
- </script>
- </head>
- <body>
- <table id="myTable" border="1">
- <tr>
- <td>cell 1</td>
- <td>cell 2</td>
- </tr>
- <tr>
- <td>cell 3</td>
- <td>cell 4</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="cell()" value="Alert first cell">
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <script type="text/javascript">
- function cell()
- {
- var x=document.getElementById('myTable').rows[0].cells;
- alert(x[1].firstChild.Value);
- }
- </script>
- </head>
- <body>
- <table id="myTable" border="1">
- <tr>
- <td>cell 1</td>
- <td><input type="text" id="txt"></td>
- </tr>
- <tr>
- <td>cell 3</td>
- <td>cell 4</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="cell()" value="Alert first cell">
- </body>
- </html>
thanks
Swetha