<script type="text/javascript">
var mychar= document.getElementById("con") ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello word";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
var mychar= document.getElementById("con") ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello word";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
2016-04-23
<!doctype html>
<html>
<head>
<mate http-equiv="Content-type" content="text/html charset=UTF-8"/>
<title>hello</title>
</head>
<body>
<h1>你说兹瓷不兹瓷</h1>
<h2>图样图森破</h2>
<h3>无可奉告</h3>
<p>你们这些年轻人</p>
</body>
</html>
<html>
<head>
<mate http-equiv="Content-type" content="text/html charset=UTF-8"/>
<title>hello</title>
</head>
<body>
<h1>你说兹瓷不兹瓷</h1>
<h2>图样图森破</h2>
<h3>无可奉告</h3>
<p>你们这些年轻人</p>
</body>
</html>
<script type="text/javascript">
function hidetext()
{
var mychar = document.getElementById("con"); mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
function hidetext()
{
var mychar = document.getElementById("con"); mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
2016-04-23
function openWindow(){
var yon=confirm("yes or no");
if(yon==true){
var web=prompt("请输入","http://www.baidu.com");
window.open(web,"_blank","width=400,height=500");
}
else
var yon=confirm("yes or no");
if(yon==true){
var web=prompt("请输入","http://www.baidu.com");
window.open(web,"_blank","width=400,height=500");
}
else
<script type="text/javascript">
var mystr="我是";
var mychar="JavaScript";
document.wtite(mychar+"<br/>");
document.write(mystr+mychar+"的忠实粉丝")
</script>
var mystr="我是";
var mychar="JavaScript";
document.wtite(mychar+"<br/>");
document.write(mystr+mychar+"的忠实粉丝")
</script>
2016-04-22
最新回答 / 小李子喵喵喵
onclick 事件中调用方法时,要加括号!! <input type="button" value="改变颜色" onclick="but1()"> <input type="button" value="改变宽高" onclick="but2()"> <input type="button" value="隐藏内容" onclick="hidetext()"> <input type="button" value="显示内容" on...
2016-04-22