About dynamically creating input input boxes We used the JS Dom to operate, mainly using the document.createelement to create an input object, and then set properties to the object.
<!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
< Meta http-equiv= "Content-type" content= "text/html;" charset=gb2312 "/>
<title> Web effects Click the table into a text input box </title>
<script language= "JavaScript" >
Convert a cell into a text box
function Changetotext (obj)
{
var tdvalue = Obj.innertext;
Obj.innertext = "";
var txt = document.createelement ("input");
Txt.type = "text";
Txt.value = Tdvalue;
Txt.id = "_text_111cn.net_";
Obj.appendchild (TXT);
Txt.select ();
Obj.style.border = "1px dashed #ff9900";
}
</script>
<body>
<div id= "Thisbox" onclick= "Changetotext (this);" > Click me to try </div>
</body>
<!--
This example uses the function introduction
InnerText
The content from the start position to the ending position, but it removes the HTML tag
Creating nodes
CreateElement ()
var node = document.createelement ("div");
Nothing to say, create an element node, but note that this node is not automatically added to the document
var value = document.createTextNode ("text");
Create a text node that adds content to the common elements node
-->