add input text into html table td when double clicked
I Have an html table with rows, in one of the cells i want to be able to insert an input text inside the cell whenever it is double clicked. and when this input is onblured i want to remove it and see it's value inside the td.

this is my code:

    <td dir='ltr' id='test1' class='tLine' nowrap ondblclick='addInput(this);'>sdadfew</td>

            function addInput(xxx) {      
              var id = xxx.id;
              var value = document.getElementById(id).innerHTML;
              document.getElementById(id).innerHTML = "<input type='text' id='input"+id +"' value='"+value+"' onblur='closeInput("+id+")'/>";            
              document.getElementById("input"+id).focus();                
            }
            
            function closeInput(id) {      
                var value = document.getElementById('input'+id).value;                
                document.getElementById(id).innerHTML = value;                  
            }   

The problem is when i double click the input i get the text of the inuput inside of it..
how can i prevent from this to happen? how can i resolve this issue?

Thank's In Advance.
  
add input text into html table td when double clicked
===

I Have an html table with rows, in one of the cells i want to be able to insert an input text inside the cell whenever it is double clicked. and when this input is onblured i want to remove it and see it's value inside the td.

this is my code:

    <td dir='ltr' id='test1' class='tLine' nowrap ondblclick='addInput(this);'>sdadfew</td>

            function addInput(xxx) {      
              var id = xxx.id;
              var value = document.getElementById(id).innerHTML;
              document.getElementById(id).innerHTML = "<input type='text' id='input"+id +"' value='"+value+"' onblur='closeInput("+id+")'/>";            
              document.getElementById("input"+id).focus();                
            }
            
            function closeInput(id) {      
                var value = document.getElementById('input'+id).value;                
                document.getElementById(id).innerHTML = value;                  
            }   

The problem is when i double click the input i get the text of the inuput inside of it..
how can i prevent from this to happen? how can i resolve this issue?

Thank's In Advance.
  