Originally Posted by low tech
var inpt = '<input type="text" name="" value="">';
Aaarrrgggghhhh! document.write is obsolete!!! What is this project? Some sort of homework?
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.