请问如何在html中的form里实现:单击选中下拉菜单中的一项后弹出风险提示呢,试过了链接javascript但没反应,谢谢各位了~
<div id="select">
<select name="select" placeholder="Please choose the size of the burger" id="select">
<option>Please choose the size of the burgeroption>
<option>6oz Larger 7.00 eurooption>
<option>10oz Extra-Larger 9.00 eurooption>
**<option onclick="a_function()">16oz Supersize 17.50 eurooption>**
select>
div>
function a_function(){
alert("Supersize burger is super huge, please confirm whether to continue");
}
大致是这个样子,在这个下拉菜单中实现单击16oz后弹窗,谢谢啦!
<div id="select">
<select name="select" placeholder="Please choose the size of the burger" onclick="a_function()" id="selectss">
<option value="1" >Please choose the size of the burger</option>
<option value="2" >6oz Larger 7.00 euro</option>
<option value="3" >10oz Extra-Larger 9.00 euro</option>
**<option value="4" >16oz Supersize 17.50 euro</option>**
</select>
</div>
<script>
function a_function(){
var obj=document.getElementById("selectss");
if(obj.value=='4'){
alert("Supersize burger is super huge, please confirm whether to continue");}
}
</script>