Js complete an action