最赞回答 / 在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
{ }
}
25行那里应该是<p id="p1" class="one">,27行是<p id="p2" class="two">,这样才能对应。
2016-07-26
<script type="text/javascript">
function rec(){
var mymessage=confirm("你爱男男吗?"); ;
if(mymessage==1)
{
document.write("你是gay!");
}
else
{
document.write("你要么是妹纸要么不举!");
}
}
</script>
function rec(){
var mymessage=confirm("你爱男男吗?"); ;
if(mymessage==1)
{
document.write("你是gay!");
}
else
{
document.write("你要么是妹纸要么不举!");
}
}
</script>
2016-07-26