window.open("http://www.imooc.com","_blank","width=600,height=400,top=100px,left=0,status=no,scrollbars=yes")
2015-11-11
已采纳回答 / 看叶子落了
不是,只是他设置了一个按钮而已,实际上重要的是onclick="contxt()",它表示点击元素触发函数contxt(),你高兴也可以这样写<p onclick="contxt()">点击</p>
2015-11-10
<script type="text/javascript">
var score=80;
if(score>=80)
{ document.write("很棒,成绩及格了。"}
else
{ document.write("加油,成绩不及格。"); }
</script>
</head> <body> </body> </html>
var score=80;
if(score>=80)
{ document.write("很棒,成绩及格了。"}
else
{ document.write("加油,成绩不及格。"); }
</script>
</head> <body> </body> </html>
2015-11-10
var mycon = document.getElementById('con');
var mytxt = document.getElementById('txt');
function chcolor(){
mycon.style.color = 'red';
}
function chwidth(){
mytxt.style.width = "400px";
}
function disnone(){
mytxt.style.display = "none";
}
var mytxt = document.getElementById('txt');
function chcolor(){
mycon.style.color = 'red';
}
function chwidth(){
mytxt.style.width = "400px";
}
function disnone(){
mytxt.style.display = "none";
}
添加<script>标签,使第7行代码运行,结果窗口显示"开启JS之旅!"
2015-11-10
<script language="javascript">
document.write("开启JS之旅!");
</script>
document.write("开启JS之旅!");
</script>
2015-11-10
confirm 消息对话框通常用于允许用户做选择的动作,如:“你对吗?”等。弹出对话框(包括一个确定按钮和一个取消按钮)。
2015-11-09
function rec(){
var mymessage=confirm("你是高富帅吗?") ;
if(mymessage==true)
{
document.write("你是高富帅!");
}
else
{
document.write("你是屌丝!");
}
}
var mymessage=confirm("你是高富帅吗?") ;
if(mymessage==true)
{
document.write("你是高富帅!");
}
else
{
document.write("你是屌丝!");
}
}
2015-11-09