Js to change view attached