📄 实例1.随机产生文本.html
字号:
您最喜欢中国的哪个城市:
<script language="JavaScript">
<!--
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = '北京'
quotes[2] = '上海'
quotes[3] = '广州'
quotes[4] = '哈尔滨'
quotes[5] = '长春'
quotes[6] = '武汉'
quotes[7] = '沈阳'
quotes[8] = '大连'
quotes[9] = '呼和浩特'
quotes[0] = '成都'
var quote = quotes[rand1]
document.write( quote )
// -->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -