function onc1() {
var n = document.getElementById("z");
var x = n.value;
if (n == "q") {
fun(x);
} else if (n == "e") {
fun1(x);
} else {
fun2(x);
}
}
function onc1() {
var n = document.getElementById("z");
var x = n.value;
var id=n.getAttribute("id");
if (id == "q") {
fun(x);
} else if (id== "e") {
fun1(x);
} else {
fun2(x);
}
}
你的这个z如果是input标签,那这么写没问题,具体得看是什么标签,不然.value不一定可以获取到