为了账号安全,请及时绑定邮箱和手机立即绑定

帮帮忙咯 新手一枚

function setCon() {    var message=confirm("你确定取消设置么?") ;    if(message==true)    {   var txt1=document.getElementById("txt");        txt1.style.removeAttribute('style'); }关于这样 为什么点击按钮没有效果呀呀呀?

正在回答

3 回答

txt1后面没有style

0 回复 有任何疑惑可以回复我~

txt1.removeAttribute("style");就可以了,具体不太清楚

0 回复 有任何疑惑可以回复我~

那样是直接搬掉了整个style!

尝试:

txt1.style.color=null;
txt1.style.width=null;
txt1.style.height=null;
txt1.style.display=null;


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

帮帮忙咯 新手一枚

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号