我遇到一個問題,從select中獲取值並將其放在var上。從select中獲取一個變量值並將其傳遞給另一個JS文件
HTML
<select id="customer_select"" name="customer_select" class="select" onchange="findcustid(this.value)" >';
JS
function findcustid() {
var cus = document.getElementById('customer_select');
var customer_select = cus.options[cus.selectedIndex].value;
}
var customer_id = customer_select;
任何幫助表示讚賞!
'customer_select'是本地的'findcustid',當你執行'VAR和客戶id = customer_select不存在;'。你聲稱擁有的問題究竟是什麼? – 2013-04-22 15:39:13