注意是mycon.innerHTML 获取元素对象, 而不是mycon.innerHTML("<br>");
2016-07-27
-------------------------------------
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
-------------------------------------
注意改变背景颜色的时候,是backgroundColor,区分大小写。(懵了一会才发现我原本代码的问题)
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
-------------------------------------
注意改变背景颜色的时候,是backgroundColor,区分大小写。(懵了一会才发现我原本代码的问题)
2016-07-27
dom解析是顺序执行, 如果getelementByID(“con”) 执行时,每有《p》
但<p id = "con"> javascript<//p>在<body>中,
但<p id = "con"> javascript<//p>在<body>中,
2016-07-27
最赞回答 / 在imooc从零开始
将document.getElementById("txt").removeAttribute("style");改为document.getElementById("txt").style.cssText="";清空js设置的内联css样式
2016-07-27
已采纳回答 / 很小白的大白
if(confirm("是否确定取消设置?")==true) vae mycancle=document.getElementById("txt");
2016-07-27
已采纳回答 / 慕粉3511002
因为通过“document.getElementById("txt1").style.width="100px";”方式设置的是内联样式,txtt类是嵌入式样式,优先级低。而且这个类在你设置样式的时候一直都存在,所以并不存在改变类一说。一种解决方案是将bac函数中的p2.className="txtt"; 改为 p2.style.cssText="";(清空内联css样式)。
2016-07-27
已采纳回答 / smallyu
<input name="button" type="button" onClick="liu()" value="点击我,打开新窗口!">应该是<input name="button" type="button" onClick="wopen()" value="点击我,打开新窗口!">是你定义的函数名
2016-07-26
function openWindow(){
var aa=comfirm("是否打开");
var bb=prompt("请输入网址","http://www.imooc.com/");
if(aa==true)
{window.open("width=400,height=500,menubar=no,toolbar=no")}
else
{ }
}
var aa=comfirm("是否打开");
var bb=prompt("请输入网址","http://www.imooc.com/");
if(aa==true)
{window.open("width=400,height=500,menubar=no,toolbar=no")}
else
{ }
}