Moved javascript

Javascript moved to the bottom to access all html tags. Autocomplete
search now working as intended, albeit inset is false.