87,916
社区成员
发帖
与我相关
我的任务
分享
function Ctlpurpose() {
var obj = document.getElementById("select_1"); //定位id
var index = obj.selectedIndex; // 选中索引
function Ctlpurpose(select_id) {
var obj = document.getElementById(select_id); //定位id
var index = obj.selectedIndex; // 选中索引
function Ctlpurpose(select_id) {
var obj = document.getElementById(select_id); //定位id
console.log(obj) // 如果打印obj不是一个dom结构,那就是没找到这个id的dom,如果找到就是没有selectedIndex这个属性
var index = obj.selectedIndex; // 选中索引