document.write("hello");
document.getElementById("p1").style.color="blue";
不要忘了区分大小写和分号
document.getElementById("p1").style.color="blue";
不要忘了区分大小写和分号
2016-06-21
<script type " text.javascript"><script>
2016-06-21
我记得获得元素有三种形式:document.getElementById(); document.getElementByTagName(); document.getElementByName();后面两种得到的是数组。
2016-06-21
如果在javascript前面加上window.onload = function(){}就是页面加载完以后才会执行就不会显示为null了
2016-06-21
function openWindow(){
var new1 = confirm("是否打开新的网页");
if(new1==1){
window.open("http://www.imooc.com","_black","width=400px","height=500px");
} else {
return;
}
}
var new1 = confirm("是否打开新的网页");
if(new1==1){
window.open("http://www.imooc.com","_black","width=400px","height=500px");
} else {
return;
}
}
已采纳回答 / eagle_thr
style:样式风格。主要指代HTML标签内容中的颜色,字体,大小等css样式。<h style="font-size:10px;font-color:red">innerhtml</h>type:HTML元素类型。<input type="button" value="button name" onclick="function()" />
2016-06-20