国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

App下載
首頁javascriptdivJavascript Element - 如何在帶有鏈接的div中更改文本,并在每次鏈接被點(diǎn)擊時(shí)保持更改

Javascript Element - 如何在帶有鏈接的div中更改文本,并在每次鏈接被點(diǎn)擊時(shí)保持更改

我們想知道如何在帶有鏈接的div中更改文本,并在每次鏈接被點(diǎn)擊時(shí)保持更改。

<!DOCTYPE html>
<html>
<body>
  <div id="test">Hello</div>
<script type='text/javascript'>

(function(){
    var texts = [
    'This is the first message',
    'This is the second message',
    'This is the last message'
    ], i = 0;
    document.getElementById('test').onclick = function(){
        this.innerHTML = texts[i++ % texts.length];
    }
})();

</script>
</body>
</html>