JS试题
2021-03-11 07:33
标签:ack line cli use col button alt mamicode floor 0单人间1双人间2三人间3套房 JS试题 标签:ack line cli use col button alt mamicode floor 原文地址:https://www.cnblogs.com/tanzizheng/p/12839908.html
p id="para">p>
script type="text/javascript">
let line = document.getElementById(‘para‘);
let Room = [‘单人间‘,‘双人间‘,‘三人间‘,‘套房‘];
for(let i = 0;iRoom.length;i++){
line.innerHTML += i + Room[i]
}
script>
input type="input" name="" id="url" value="" />
script type="text/javascript">
document.getElementById(‘url‘).value=window.location.href;
script>
p id="test" onclick="uptext()">单击更改内容p>
input type="button" name="" id="" value="更改内容" onclick="uptext()"/>
script type="text/javascript">
function uptext(){
document.getElementById(‘test‘).innerHTML = Math.floor(Math.random()*10);
}
script>
input type="button" name="" id="noun" value="按钮" onclick="show_text()"
onmouseover = show_red() onmouseout = show_blue()
style="background-color:blue;color:while;"/>
script>
function show_red(){
let noun = document.getElementById(‘noun‘)
noun.style.backgroundColor = ‘red‘;
}
function show_blue(){
let noun = document.getElementById(‘noun‘)
noun.style.backgroundColor = ‘blue‘;
}
function show_text(){
alert(‘欢迎!‘)
}
script>
上一篇:项目首次上传至git仓库步骤
下一篇:js-1