to:yonghengdizhen(IUnknown::AddRef()) 不对啊group1.removeChild('txtminAlertLimit');
说类型不匹配
再问一下:
如何删除group1里面所有得元素?
谢谢

解决方案 »

  1.   

    removeNode Method--------------------------------------------------------------------------------Removes the object from the document hierarchy.SyntaxoRemoved = object.removeNode( [bRemoveChildren])
    ParametersbRemoveChildren Optional. Boolean爐hat specifies one of the following values: false Default. childNodes collection of the object is not removed. 
    true childNodes collection of the object is removed. 
     Return ValueReturns a reference to the object that is removed.ResThis property is accessible at run time. If elements are removed at run time, before the closing tag is parsed, areas of the document might not render.ExampleThis example uses the removeNode method to remove a table from the document hierarchy.<SCRIPT>
    function fnRemove(){
        // 'true' possible value specifies removal of childNodes also
       oTable.removeNode(true);
    }
    </SCRIPT><TABLE ID = oTable>
    <TR>
    <TD>Cell 1</TD>
    <TD>Cell 2</TD>
    </TR>
    </TABLE><INPUT TYPE = button VALUE = "Remove Table" onclick = "fnRemove()">
      

  2.   

    代码如下:(我点了"点这里显示曲线1”后,然后点“test”钮,确实删了,不过好像连group也删了,再点"点这里显示曲线1”时开始报错)<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>棒图</title>
    <STYLE> v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    <script>
    function drawBar(n,h)   //在第n个棒图的底图上画高为h的棒图
    {
        document.all("bar" + n).style.height=h;
        document.all("bar" + n).style.top=2700-h;
    }
    function drawBarBack(n,maxLimit,minLimit,maxAlertLimit,minAlertLimit)   //画第n个棒图的底图,最大上限,最低下限,报警上限,报警下限
    {
        var h=2450;
        var pLeft=200+n*700
        //画表示底图的框
        var newShape= document.createElement("<v:rect style='position:absolute;left:"+pLeft+";top:250;WIDTH:300px;HEIGHT:"+h+"px;z-index:1' coordsize='21600,21600' fillcolor='white'><v:fill opacity='1'/> </v:rect>")    
        group1.insertBefore(newShape);
        //画表示棒图的框
        var newRect= document.createElement("<v:rect id='bar" + n + "' style='position:absolute;left:"+(pLeft+120)+";top:2300;WIDTH:60px;HEIGHT: 400px;z-index:2' fillcolor='red'> </v:rect>")    
        group1.insertBefore(newRect);
    }function test()
    {
        group1.removeNode(true);
    }
    </script>
    </head>
    <body>
    <v:group id="group1" style="WIDTH: 800px; HEIGHT: 600px" coordsize="4900,3500">
    </v:group>
    <button id="Button1" onclick="drawBarBack(3,100,20,80,40)" type="button">点这里显示曲线1</button>
    <button id="Button4" onclick="test()" type="button">test</button>
    <INPUT id="aa" type="text" size="5">
    </body>
    </html>
      

  3.   

    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>棒图</title>
    <STYLE> v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    <script>
    function drawBar(n,h)   //在第n个棒图的底图上画高为h的棒图
    {
        document.all("bar" + n).style.height=h;
        document.all("bar" + n).style.top=2700-h;
    }
    function drawBarBack(n,maxLimit,minLimit,maxAlertLimit,minAlertLimit)   //画第n个棒图的底图,最大上限,最低下限,报警上限,报警下限
    {
        var h=2450;
        var pLeft=200+n*700
        //画表示底图的框
        var newShape= document.createElement("<v:rect style='position:absolute;left:"+pLeft+";top:250;WIDTH:300px;HEIGHT:"+h+"px;z-index:1' coordsize='21600,21600' fillcolor='white'><v:fill opacity='1'/> </v:rect>")    
        group1.insertBefore(newShape);
        //画表示棒图的框
        var newRect= document.createElement("<v:rect id='bar" + n + "' style='position:absolute;left:"+(pLeft+120)+";top:2300;WIDTH:60px;HEIGHT: 400px;z-index:2' fillcolor='red'> </v:rect>")    
        group1.insertBefore(newRect);
    }function test()
    {
        group1.innerHTML="";
    }
    </script>
    </head>
    <body>
    <v:group id="group1" style="WIDTH: 800px; HEIGHT: 600px" coordsize="4900,3500">
    </v:group>
    <button id="Button1" onclick="drawBarBack(3,100,20,80,40)" type="button">点这里显示曲线1</button>
    <button id="Button4" onclick="test()" type="button">test</button>
    <INPUT id="aa" type="text" size="5">
    </body>
    </html>
      

  4.   

    这样吧~~~
    ***************************
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>棒图</title>
    <STYLE> v\:* { BEHAVIOR: url(#default#VML) }
    </STYLE>
    <script>
    function drawBar(n,h)   //在第n个棒图的底图上画高为h的棒图
    {
        document.all("bar" + n).style.height=h;
        document.all("bar" + n).style.top=2700-h;
    }
    function drawBarBack(n,maxLimit,minLimit,maxAlertLimit,minAlertLimit)   //画第n个棒图的底图,最大上限,最低下限,报警上限,报警下限
    {
        var h=2450;
        var pLeft=200+n*700
        //画表示底图的框
        var newShape= document.createElement("<v:rect style='position:absolute;left:"+pLeft+";top:250;WIDTH:300px;HEIGHT:"+h+"px;z-index:1' coordsize='21600,21600' fillcolor='white'><v:fill opacity='1'/> </v:rect>")    
        group1.insertBefore(newShape);
        //画表示棒图的框
        var newRect= document.createElement("<v:rect id='bar" + n + "' style='position:absolute;left:"+(pLeft+120)+";top:2300;WIDTH:60px;HEIGHT: 400px;z-index:2' fillcolor='red'> </v:rect>")    
        group1.insertBefore(newRect);
    }function test()
    {
        var h=2450;
        var pLeft=200+1*700
        var it="<v:rect style='position:absolute;left:"+pLeft+";top:250;WIDTH:300px;HEIGHT:"+h+"px;z-index:1' coordsize='21600,21600' fillcolor='white'><v:fill opacity='1'/> </v:rect>";
        group1.innerHTML=it;
    }
    </script>
    </head>
    <body>
    <v:group id="group1" style="WIDTH: 800px; HEIGHT: 600px" coordsize="4900,3500">
    </v:group>
    <button id="Button1" onclick="drawBarBack(3,100,20,80,40)" type="button">点这里显示曲线1</button>
    <button id="Button4" onclick="test()" type="button">test</button>
    <INPUT id="aa" type="text" size="5">
    </body>
    </html>