fixing bug caused by input element was being inserted before document is...

Fix bug causing ```Uncaught TypeError: Cannot read property 'setSelectionRange' of null```. Input element was being inserted before document ready.