Move inline JS at the end of DOM