<!DOCTYPE html> <html> <head> <body onload="var bar = document.createElement('input'); bar.defaultValue='This is a test'; document.getElementById('foo').appendChild(bar)"> <div style="display: table; margin-left: 100px"> <div style="display: table-row"> <div style="float: right;" id="foo"> </div> </div> </div> </body> </html>