document.write(mychar+"<br>");
document.write(mystr+mychar+"的忠实粉丝")
document.write(mystr+mychar+"的忠实粉丝")
2015-08-13
<script type="text/javasript">
var mychar=document.getElementById("con");
document.write("原标题"+mychar.innerHTML+"</br>");
mychar.innerHTML="HELLO WORLR!"
document.write("修改后的标题"+mychar.innerHTML);
</SCRIPT>
var mychar=document.getElementById("con");
document.write("原标题"+mychar.innerHTML+"</br>");
mychar.innerHTML="HELLO WORLR!"
document.write("修改后的标题"+mychar.innerHTML);
</SCRIPT>
2015-08-13
<script type="text/javascript">
document.write("开启JS之旅!");
</script>
document.write("开启JS之旅!");
</script>
2015-08-12
function openWindow(){
var sure=confirm("确认打开?");
if (sure==true)
{var new= prompt("输入网址链接","wwww.hupu.com");
if(new!=null)
window.open('http://www.hupu.com/', '_blank','width=400,height=500,menubar=no,toolbar=no');
}
else {
return false;
}
}
var sure=confirm("确认打开?");
if (sure==true)
{var new= prompt("输入网址链接","wwww.hupu.com");
if(new!=null)
window.open('http://www.hupu.com/', '_blank','width=400,height=500,menubar=no,toolbar=no');
}
else {
return false;
}
}
BUG!!!
在chrome浏览器添加这行代码mywin.close();时一直打开新窗口,
于是
只能先把var mywin=window.open("http://www.imooc.com");注释掉!
在chrome浏览器添加这行代码mywin.close();时一直打开新窗口,
于是
只能先把var mywin=window.open("http://www.imooc.com");注释掉!
2015-08-12
错误写法:window.open('http://imooc.com','_blank','width=600','height=400','top=100','left=0');
正确写法:window.open('http://imooc.com','_blank','width=600,height=400,top=100,left=0')
正确写法:window.open('http://imooc.com','_blank','width=600,height=400,top=100,left=0')
2015-08-12
注意 这个地方的 className ,还有前面提到过的getElementById等等都必须严格遵循驼峰法 否则将不起作用
2015-08-11