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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -