I have submit function on a button. Upon clicking "submit" a dialog box pops and asks for confirmation and after clicking "ok" the form is submitted.
Now I want to add another function in which upon clicking "ok" the form should be submitted & background color of page should also change. The code I wrote is given below. but now even the form is not submitting nor background color is changing. Help needed!
function myfunction(e) {
if (!confirm('Are you sure to proceed with this role?')) {
changecolor(e);
e.preventDefault();
} else {
return false;
}
}
function changecolor(e) {
e.target.classList.add('custom_back')
}
.custom_back{
backgroundcolor: #0065bd; }
question from:
https://stackoverflow.com/questions/65870432/function-within-function-in-javascript-not-working 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…