如下所示代码 onclick事件不触发 怎么修改
<divclass="textBox"id="textBox"><ul><pclass="changeContentBtnother"onclick="a()">返回</...
<div class="textBox" id="textBox">
<ul>
<p class="changeContentBtn other" onclick="a()">返回</p>
<li>Z</li>
<li>X</li>
<li>C</li>
<li>V</li>
<li>B</li>
<li>N</li>
<li>M</li>
<p class="deleteBtn other">删除</p>
</ul>
</div>
<script>
function a() {
var back = document.getElementById("textBox").getElementsByTagName("p");
for (var b=0;b<back.length;b++){
var abc = this.innerText;
if(abc == "返回"){
document.getElementById("textBox").style.display = "none";
document.getElementById("provienceBox").style.display="block";
}
}
}
</script> 展开
<ul>
<p class="changeContentBtn other" onclick="a()">返回</p>
<li>Z</li>
<li>X</li>
<li>C</li>
<li>V</li>
<li>B</li>
<li>N</li>
<li>M</li>
<p class="deleteBtn other">删除</p>
</ul>
</div>
<script>
function a() {
var back = document.getElementById("textBox").getElementsByTagName("p");
for (var b=0;b<back.length;b++){
var abc = this.innerText;
if(abc == "返回"){
document.getElementById("textBox").style.display = "none";
document.getElementById("provienceBox").style.display="block";
}
}
}
</script> 展开
1个回答
展开全部
<div class="textBox" id="textBox">
<ul>
<p class="changeContentBtn other" onclick="a(this)">返回</p>
<li>Z</li>
<li>X</li>
<li>C</li>
<li>V</li>
<li>B</li>
<li>N</li>
<li>M</li>
<p class="deleteBtn other">删除</p>
</ul>
</div>
<script>
function a(o) {
var back = document.getElementById("textBox").getElementsByTagName("p");
for (var b=0;b<back.length;b++){
var abc = o.innerText;
if(abc == "返回"){
document.getElementById("textBox").style.display = "none";
//document.getElementById("provienceBox").style.display="block";
}
}
}
</script>记得采纳哦
<ul>
<p class="changeContentBtn other" onclick="a(this)">返回</p>
<li>Z</li>
<li>X</li>
<li>C</li>
<li>V</li>
<li>B</li>
<li>N</li>
<li>M</li>
<p class="deleteBtn other">删除</p>
</ul>
</div>
<script>
function a(o) {
var back = document.getElementById("textBox").getElementsByTagName("p");
for (var b=0;b<back.length;b++){
var abc = o.innerText;
if(abc == "返回"){
document.getElementById("textBox").style.display = "none";
//document.getElementById("provienceBox").style.display="block";
}
}
}
</script>记得采纳哦
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询