最新回答 / wty521
function changeSS(){ var a=document.getElementById("txt"); a.style.width="300px"; a.style.height="200px";}是改div的宽高
2016-03-18
最新回答 / qq_夏日青枫_0
你<input>语句中onClick="函数名"是不是没有和function 函数名对应起来?例如:function changeS(){var a=document.getElementById("txt");a.style.height="200px";a.style.width="300px"}
2016-03-18
<script type="text/javascript">
document.write("开启JS之旅");
</script>
document.write("开启JS之旅");
</script>
2016-03-18
已采纳回答 / forever868
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" Content="text/html; charset=utf-8" /><title>javascript</title><style type="text/css">body{font-size:12px;}#txt{ height:400px; width:600px; border:#3...
2016-03-18
function openWindow(){
if(confirm("是否打开新窗口?")){
var url=prompt("请输入网址:","http://www.imooc.com/");
window.open('url','_blank','width=400, height=500,menubar=no, toolbar=no');
}
}
if(confirm("是否打开新窗口?")){
var url=prompt("请输入网址:","http://www.imooc.com/");
window.open('url','_blank','width=400, height=500,menubar=no, toolbar=no');
}
}
<p id="p1">我是第一段文字</p>
<p id="p2">我是第二段文字</p>
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
<p id="p2">我是第二段文字</p>
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
2016-03-17
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("p1").style.color="blue";
2016-03-17
<script type="text/javascript">
var mychar=document.getElementById("con"); ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello,world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
var mychar=document.getElementById("con"); ;
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML="Hello,world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
2016-03-17
已采纳回答 / qq_北葵_0
错误一: if(mywin1="http://www.imooc.com/"); 后面那个分号不能用。每一个if语句后面跟的else如果没有要表达的话,可以省略,也可以加上(else;)错误二:你在写网址的时候应该切换成英文输入,而不是中文输入。(这是打不开的主要原因)错误三:window.open( )括号里应该是单引号,如果你要在新的窗口中打开的话要加一个('_blank')
2016-03-17