How to use the false of confirm to cancel the handover of option in select?

suddenly came up with a question: can I use the false of confirm to cancel the switching of option under select?
`
< select name= "" id= "sel" >

<option selected value="">coder"s life</option>
<option value="">code makes me happy</option>
<option value="">and makes me old</option>

< / select >

var sel = document.getElementById("sel")
sel.onchange = function(){
    if(confirm("")){
        // 
    }else{
    // 
        return
    }
}`

but even if you choose to cancel this method, you will switch to another option,. I would like to ask the Great God how to choose the false of confirm without switching option

.
Mar.09,2021
The

change event has already been switched off, so you need to remember the option you selected last time, and manually switch to the last option when confirm is false.

Menu