用js怎么实现不同元素点击事件
1个回答
展开全部
function firstClick () {
// body...
}
function secClick () {
// body...
}
$("#ele").className = "first"
$("#ele").onclick=function () {
if (this.className === "first") {
this.className = "sec"
firstClick()
} else{
this.className = "first"
secClick ()
};
}
// body...
}
function secClick () {
// body...
}
$("#ele").className = "first"
$("#ele").onclick=function () {
if (this.className === "first") {
this.className = "sec"
firstClick()
} else{
this.className = "first"
secClick ()
};
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询