[英]Toggle with icon change
I have toggle and working. 我有切换和工作。 Now I want include icon, this not working. 现在我要包含图标,这不起作用。
function myFunction(#menu) {
var add.icon = item.nextElementClass;
if (o.display === "block") {
o.display = "none";
} else {
o.display = "inline-block";
}
}
add()
is present on Element.classList
property. add()
存在于Element.classList
属性上。
Try 尝试
icon.classList.add('icon-up-dir');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.