JavaScript
Posted 安慧桥没有你
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript相关的知识,希望对你有一定的参考价值。
示例:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .hide { display:none; } </style> </head> <body> <div style="z-index: 1"> <div id="d1", class="c1 c3", class="c2">来最后跳一支悲伤优雅的舞蹈就散场...</div> <div id="d2">test div</div> <input type="button" value="register" onclick="register()"> </div> <div class="c1 hide"; id="reg1"; style="position: fixed; height:100px; width:300px; top:50%; left: 50%; margin-left:-150px; margin-top:-50px; background-color: coral; z-index: 100"> <input type="text" value="username" style="display: block;"> <input type="password" style="display: block;"> <input type="submit" value="submit"> <input type="reset"> </div> <div class="c2 hide"; id=‘zzc‘; style="position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; background-color: gray;opacity: 0.5; z-index: 10"> </div> </body> </html> <script> function test(){ p = document.getElementById(‘d1‘) i = p.innerText j = i.charAt(0) k = i.substring(1, i.length) // alert(j,k) p.innerText = k + j } setInterval(‘test()‘, 500) function register(){ document.getElementById(‘zzc‘).classList.remove(‘hide‘) document.getElementById(‘reg1‘).classList.remove(‘hide‘) } </script>
以上是关于JavaScript的主要内容,如果未能解决你的问题,请参考以下文章