move the js script from the html
add selfInvokingFunction in js example