Why in this code the text box that is created when I press push
is not exactly the same as the one already displayed?
<html>
<body id="bd">
<input type="text" style="width: 30px; padding: 2px; border: 1px solid black"/>
<input type="submit" value="Push" onclick="test()"/>
<script type="text/javascript">
function test() {
var txt = document.createElement('input');
txt.type = 'text';
txt.style = "width: 30px; padding: 2px; border: 1px solid black";
document.getElementById('bd').appendChild(txt);
}
</script>
</body>
</html>
Update:
What I see in the fiddle of @Bergi: