document.write("hello world!");
document.getElementById("p1").style.color="blue";
document.getElementById("p1").style.color="blue";
2016-03-13
变量,是用于储存某些数值的储存器,我们可以把变量看成一个盒子,box1,box2就是为了区分盒子而取的名字,也就是变量的名字!
2016-03-13
function openWindow(){
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
var mymessage =confirm("是否打开");
var open;
if (mymassage=true){
open=prompt("确定打开?"," http://www.imooc.com/");
}
}
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
var mymessage =confirm("是否打开");
var open;
if (mymassage=true){
open=prompt("确定打开?"," http://www.imooc.com/");
}
}
//定义"隐藏内容"的函数
aInput[2].onclick=function(){
txt.style.display='none';
}
//定义"显示内容"的函数
aInput[3].onclick=function(){
txt.style.display='block';
}
aInput[2].onclick=function(){
txt.style.display='none';
}
//定义"显示内容"的函数
aInput[3].onclick=function(){
txt.style.display='block';
}
//定义"改变颜色"的函数
var aInput=document.getElementsByTagName('input');
var txt=document.getElementById('txt');
aInput[0].onclick=function(){
txt.style.color="yellowgreen";
}
//定义"改变宽高"的函数
aInput[1].onclick=function(){
txt.style.width='800px';
txt.style.height='200px';
}
var aInput=document.getElementsByTagName('input');
var txt=document.getElementById('txt');
aInput[0].onclick=function(){
txt.style.color="yellowgreen";
}
//定义"改变宽高"的函数
aInput[1].onclick=function(){
txt.style.width='800px';
txt.style.height='200px';
}
<script type="text/javascript">
function Wopen(){
window.open('http://www.imooc.com','_blank','width=600,height=400,top=100,left=0')
}
</script>
function Wopen(){
window.open('http://www.imooc.com','_blank','width=600,height=400,top=100,left=0')
}
</script>
2016-03-13