javascript - how to add two functionality on single click of radio button -
i want add 2 functionality 1 checkbox 1 backend , 1 frontend 1st after clicking shows option on front-end , 2nd after clicking shows table enter data in backend
if understood right, want click 2 times on same element, result in 2 differents pre-defined actions.
to so, need call function keep track of number of times clicked it.
let clickcount = 0; function onclick(e) { clickcount++; if (clickcount === 1) { showoptionsonfrontend(); //your first action } else if (clickcount === 2) { showtable(); //your second action } }
is need?
a more detailed question lead more precise answers though.
Comments
Post a Comment