定义"取消设置"的函数

来源:4-1 编程挑战

long2016

2016-03-09 11:16

function ClickClear(){

    var txt1 = document.getElementById("txt");

    txt1=confirm("是否取消设置?");

    if(txt1==true){ 

        document.getElementById("txt").removeAttribute("style"); 

    

 }

写回答 关注

3回答

  • 瓶瓶罐罐_瓶子瓶子呦
    2016-03-09 14:33:54

    var mye=document.getElementById("txt");

    function resetStyle(){

        var message=confirm("你确定重置所有样式吗?");

        if(message==(true){

            mye.removeAttribute('style')

    }

    }

  • LIFE_1st
    2016-03-09 14:25:06

    除了楼上的方法还有没有其他的实现???

  • qq_脱线宅_0
    2016-03-09 11:55:13

    //定义"取消设置"的函数

    function rest(){

        if(confirm("是否取消设置")){

        var obj=document.getElementById("txt");

        obj.style.color="black";

        obj.style.backgroundColor="white";

        obj.style.width="600px";

        obj.style.height="400px";

        obj.style.display="block";

        }


JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

738661 学习 · 9561 问题

查看课程

相似问题