Expand|Select|Wrap|Line Numbers
- <table border=1>
- <tr>
- <td onmousedown="create(this)"></td>
- <td onmousedown="create(this)"></td>
- </tr>
- <tr>
- <td onmousedown="create(this)"></td>
- <td onmousedown="create(this)"></td>
- </tr>
- </table>
- <script language="javascript">
- function create(obj)
- {
- if(obj.hasChildNodes()) {
- value = obj.firstChild.nodeValue;
- }
- var children = obj.childNodes;
- for(k=0; k<children.length; k++) {
- obj.removeChild(children.item(k));
- }
- var value = "";
- var x = obj.createElement("input");
- obj.type = "text";
- obj.value = value;
- obj.focus();
- }
- </script>
Now my question is, How can I select the four <td>s, whether in the same onmousedown event or there is any onmousedrag event? please help...
If I select any one of the <td>, its border should be highlighted.
And also If I select all the <td>s, its outer border should be highlighted.
Is it possible in javascript? Similar to MS Excel.
I hope anyone of u people reply my question.
Regards,
Suresh.