<body>
<input type="button" id="btn" value="click">
<select>
<option value="">可乐</option>
<option value="">雪碧</option>
<option value="">芬达</option>
<option value="">七喜</option>
<option value="">美年达</option>
<option value="">健力宝</option>
</select>
var btn = document.getElementById('btn')
var option = document.querySelectorAll('option')
function getRandomInt(min,max) {
var a = Math.floor(Math.random() * (max - min)+ min)
console.log(a,Math.floor(Math.random() * (max - min)+ min))
return a
}
btn.onclick = function() {
option[getRandomInt(0,option.length)].selected = true
}