最赞回答 / youlookme
你的URL没写; window关键字不能当成 变量名正确写法:function openWindow(){ var str=confirm("新窗口打开网站"); if(str==true){ var http = prompt("请输入网站地址","http://www.imooc.com"); if(http!=null){ window.open("http://www.imooc.com","_blank","wi...
2016-01-25
已采纳回答 / DOMOHAHA
这里获取的元素是一个对象,输出是显示的是一个P元素对象。如想对元素进行操作,我们要通过它的属性或方法。如,我们要输出p元素的内容,那么就得用innerHTML属性。
2016-01-25
[免费福利1枚]领极客学院30天的VIP,平时30元,现在免费。可以看全站7500节视频课程,想学编程的小伙伴速来。时间有限:http://e.jikexueyuan.com/invite/index.html?ZnJvbV9jb2RlPVlORzVIVyZ1bmFtZT1xcV9iNG5qbWxhdCZjaGFubmVsPWludml0ZV9zaGFyZWJ1dHRvbl9kaXJlY3QwNA==
2016-01-25
上面说的写法太麻烦
写法二:
document.getElementById("con").style.color="red";
document.getElementById("con").style.backgroundColor="#ccc";
document.getElementById("con").style.width="600px";
写法二:
document.getElementById("con").style.color="red";
document.getElementById("con").style.backgroundColor="#ccc";
document.getElementById("con").style.width="600px";
2016-01-24