我有一个基于复选框 id 确定价格值的函数。这工作正常,除了我需要将复选框更改为选择。我试图改变这一行:
if(peo14.checked==true)
对此:
if(peo14.select==Yes)
这不起作用...如何将其更改为是/否选择?
function peoPrice()
{
var peoPrice=0;
//Get a reference to the form id="quicksheet"
var theForm = document.forms["quicksheet"];
//Get a reference to the checkbox id
var peo14 = theForm.elements["peo14"];
//If they checked the box set peoPrice to value
if(peo14.checked==true)
{
peoPrice=199;
}
//finally we return the peoPrice
return peoPrice;
}