87,902
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script type="text/javascript">
function testThis(){
alert(this.button1.ele1);
//document.getElementById("ele1").value;
return false;
}
</script>
</head>
<body>
<div align="center">
<input type="button" value="点击这里给出提示" name="button1" onclick="testThis();" ele1="哈哈"/>
<input type="button" onlick="alert(this.value);" value="Sunyang
</body>
</html>
<html>
<head>
<script type="text/javascript" src="sayHello.js">
function check(big){
alert("开始");
var user=document.getElementById("user").value;
if(user == ""){
alert("请输入用户名");
}
else{
switch(big){
case 1:helloWorld();
break;
case 2:bigHelloWorld();
break;
default:alert("出错");
}
}
}
</script>
</head>
<body>
<div align="center">用户名:<input type="text" id="user"/></div>
<div align="center"><input type="button" value="d" onclick="javascript:check(1);">
<button onclick="check(2);">SAY HELLO</button></div>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function testThis(dom){
alert(dom.ele1);
//document.getElementById("ele1").value;
return false;
}
</script>
</head>
<body>
<div align="center"><input type="button" value="点击这里给出提示" name="button1" onclick="testThis(this);" ele1="华中科技大学"/>
<input type="button" onlick="alert(this.value);" value="Sunyang"