我想<span onclick =“A2A2()”>单击=打开对话框A2 +关闭对话框A1
我想<span onclick =“A3A3()”>单击=打开对话框A3 +关闭对话框A2
<span onclick="A1A1()">[AAAAAA]</span><dialog id="A1">AAAAAA<span onclick="A2A2()">[BBBBBB]</span><dialog id="A2">BBBBBB<span onclick="A3A3()">[CCCCCC]</span><dialog id="A3">CCCCCC</dialog></dialog></dialog>
<script> var A1 = document.getElementById(“A1”); function A1A1(){A1.showModal();} </ script> <script> var A2 = document.getElementById(“A2”); function A2A2(){A2.showModal();} </ script> <script> var A3 = document.getElementById(“A3”);功能A3A3(){A3.showModal();} </ script>
Plz不使用
"$" "#" "%" "@"
首先,您只需要1个脚本标记。其次,您应该为每个要执行的操作创建函数
function closeA() {}
function openA() {}
...
然后onclick调用一个函数,该函数将依次调用您需要的函数。
function closeAOpenB() {
closeA();
openB();
}