halt the execution till the button is clicked javascript -


if have 1 function binds buttons function, how can execute codes in same function after button clicked? example, in below code, button.onclick assigns funct2(this.value) button , goes below in function execute remaining code. want achieve halt execution till click event happens.

function funct1(){    //some other codes   button.onclick=function(){funct2(this.value)};   //codes executed after funct2 responds user click    function funct2(){  //some codes  } 

don't know why confused this, try way:

move code third function & call after func2 executes...

function funct1(){    //some other codes   button.onclick=function(){funct2(this.value)};    function func3() {    //codes executed after funct2 responds user click    }    function funct2(){    //some codes    func3();    } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -