<div class="htmlarea"> <textarea id="runcode98855"> <title>让链接必须按先后顺序点击的JS代码</title> <script language="JavaScript"> var num = 2; var mypage = '/tools'; var pissoff = ' 请先点击上面链接 '; allow = Array(); allow[num] = 2; function gotoit(link){ if (link != num){ allow[link] = 2; } else { for (i=1;i<=num;i++){ if (allow[i] != 2){ i = num + 1; lemmeIn = 0; } else { lemmeIn = 1; } } if (lemmeIn == 1){ window.location = mypage; } else { alert(pissoff); } } } //---> </script> <a href="/" onclick="gotoit(1)" target="_blank"><u>请先点击这里</u></a> <a href="javascript:gotoit(num)"><u>这是正常链接</u></a> </textarea><br><input onclick="runEx('runcode98855')" type="button" value="运行代码"> <input onclick="doCopy('runcode98855')" type="button" value="复制代码"> <input onclick="doSave(runcode98855)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>