Add a row to a table in Javascript that contains input classes -


I'm trying to do it originally:

  var tr = document .createElement ("tr"); Var td = document.createElement ("td"); Td.appendChild (document.createTextNode ('& lt; input class = "param" type = "text" name = "dummy" value = "frad" /> gt;')); Tr.appendChild (TD);  

But it just displays the input ... as a normal text, how do I insert it, from which it works as if I need it ..?

im estimating it

cheers

You can either

>
  td.innerHTML = '& lt; Input class = "param" type = "text" name = "dummy" value = "friday" /> gt;  

or

  var ip = document.createElement ('Input'); Ip.className = 'Ultimate'; Ip.type = 'text'; Ip.name = 'dummy'; Ip.value = 'fred'; Td.appendChild (IP);  

Edit

That means the dynamically changing the type of an element will not be allowed to be changed. I am pretty sure that this only applies when the element is already a type and has already been inserted into the DOM. However, if this usage does not work on Method 1

to best test

Comments