怎么正确的引用对象?和使用JS清除DIV中的内容

如何正确的引用对象?和使用JS清除DIV中的内容?
1.(30p)
js中对象的引用太乱了,有时候不知道引用哪种好?如
document.all.id.value;
id.value;
document.body.all( "name ").value;
document.getElementById(id).value;
document.getElementByName(name).value;
name.value;
有时候,使用这种没有问题,使用那种就有问题,不知道到底引用那个,请问大家这些有什么区别?在什么情况下引用什么不会出错?

2.(20p)
在一页面中有一DIV,我想清除DIV中的内容,为什么以下语句不行呢?不报错,也清除不了.
<html>
<script   type= "text/javascript ">
                function   reset()
                {
                          document.all.idContent.innerHTML= " ";  
                          //document.getElementById( "idContent ")= " ";       也不行    
                }  
</script>
      <body>
              <form>
                <DIV   id= "idContent "     contentEditable= "true "   style= "WORD-BREAK:break-all;     overflow-y:scroll;WHITE-SPACE:normal;   border:2px;   border-style:inset;   LINE-HEIGHT:150%;   width:550px   ;   height:150px; "> <%=EditText%> </DIV>
              <input   id= "Button1 "     onclick= "reset() "   type= "button "   value= "重置 "   />
             
              </form>
      </body>
</html>


------解决方案--------------------
document.getElementById(id).value; // 这样兼容性最好,其它的非IE支持不好

function reset()
{
//document.all.idContent.innerHTML= " ";
document.getElementById( "idContent ").innerHTML= " ";
}

------解决方案--------------------
1,使用document.getElementById()这个是标准方法,兼容性好,all集合只是IE所特有的
2,清空使用document.getElementById( "idContent ").innerHTML = " ";

对于你的第二个问题,我把form标签给去了就没事了,汗.....

------解决方案--------------------
1.document.all.id.value;
document.body.all( "name ").value;
这两个只针对ie,以后估计要淘汰的.
id.value;
这个我还真没见过.
document.getElementById(id).
这个是w3c推荐的用法,获取id为指定值的对象.你那个.value 是调用对象的value属性,要求对象必须有value 属性才可.
document.getElementByName(name).
根据名称获取对象,也不常用了,因为现在对象一般靠id或标签来识别.
name.value;
同样的老用法,需要对象在最外层才可以.

对于对象引用,常用的该是
document.getElementById()和document.Form1.Button1形式的用法
还有document.getElementsByTagName()

2.document.getElementById( "idContent ").innerText = " ";
这样用就可以了
------解决方案--------------------
在微软的脚本语句里是这样写的:
http://i3.microsoft.com/shared/core/1/js/library.js

function getObject(elementId)
{
if (document.getElementById)
{
return document.getElementById(elementId);
}
else if (document.all)
{
return document.all[elementId];
}
else if (document.layers)
{
return document.layers[elementId];