我的代码如下: <script type= "text/javascript ">
function show(){
if(lei.innerText= "+ "){
disp.style.display= "block ";
lei.innerText= "- "
}
else{
disp.style.display= "none ";
lei.innerText= "+ "
}
}
</script>
<span id= "lei " style= "border:1px solid; cursor:hand; " onclick= "show() "> + </span> 大类1
<div id= "disp " style= "display:none "> <ul>
<li> 大1 </li>
<li> 大2 </li>
<li> 大3 </li>
</ul> </div>
<span id= "lei2 "> 小类 </span>
可以放,怎么不能收啊?还请师兄门赐教!~~~
------解决方案--------------------
if(lei.innerText= "+ "){
有你这样写判断语句的吗?? 竟然直接用 赋值等号
if(lei.innerText == "+ "){
------解决方案--------------------
if(lei.innerText= "+ ")
语法不对了