<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
document.write("!!!");
document.write("???");
function myfunction()
{
x=document.getElementById("11");
x.innerHTML = "hellow";
}
</script>
<button type="button" onclick="myfunction()">点我
</button>
<p id="11">bibibibibib
</p>
<script type="text/javascript">
function changeImg(){
img=document.getElementById("img");
if(img.src.match("1.jpg")){
img.src="C:/Users/石焱文/Desktop/html练习/2.jpg";
}else{
img.src="C:/Users/石焱文/Desktop/html练习/1.jpg";
}
}
</script>
<img id="img" onclick="changeImg()" src="C:/Users/石焱文/Desktop/html练习/1.jpg" width="300" height="240">
<br>
<script type="text/javascript">
function changeCSS(){
element=document.getElementById("button1");
element.style.color="#FF0000";
}
</script>
<button id="button1" onclick="changeCSS()" style="color: #FFFF00;">改变样式
</button>
<script type="text/javascript">
function yanzheng(){
var x=document.getElementById("input1").value;
if(x==""||isNaN(x))
alert("请输入数字!");
}
</script>
<br>
<input id="input1" type="text" name="">
<button onclick="yanzheng()">验证文本
</button>
</body>
</html>
转载请注明原文地址: https://lol.8miu.com/read-8714.html