为什么在调用setEndPoint时提示参数无效?
var   text=document.getElementById( 'txtInput ');   //这是一个TextArea 
                            text.focus(); 
 	var   curRange=document.selection.createRange(); 
 	var   fullRange=text.createTextRange(); 
 	fullRange.collapse(true);       
 	curRange.setEndPoint( 'StartToStart ',fullRange);      //这句报参数无效 
 	curRange.select();   
 我仔细查过文档,我找不出为什么出错,我看过相关的案例,跟我写得也一样,不过在我这儿也报同样的错
------解决方案--------------------不是太会用这个东西,不过你要做什么呢? 
 如果是全选的话,这样就可以: 
  <textarea id= "txtInput "> 是一个TextArea </textarea>  
  <script language= "javascript ">  
 var text=document.getElementById( 'txtInput '); //这是一个TextArea 
 text.select();   
  </script>
------解决方案--------------------好象textarea就是不好使,换了input就没问题了 
  <HTML>  <HEAD>  <TITLE> rl </TITLE>  
  <META http-equiv=Content-Type content= "text/html; charset=gb2312 ">  
  <script language= "javascript ">  
 function getCaret(textbox)  
 {  
  var control = document.activeElement;  
  textbox.focus();  
  var rang = document.selection.createRange();  
   rang.setEndPoint( "StartToStart ",textbox.createTextRange())  
  control.focus(); 
  pos.innerText = rang.text.length; 
  return rang.text.length;  
 }   
  </script>  
  </HEAD>  
  <BODY>  
  <form>  
  <textarea id= "txtInput " onclick= "getCaret(this) " onkeydown= "getCaret(this) "> 是一个TextArea </textarea>  
  <input id= "txtInput " onclick= "getCaret(this) " onkeydown= "getCaret(this) " value= "是一个TextArea ">  
  <span id= "pos "> 这里显示光标的位置 </span>  
  </form>  
  </BODY>  </HTML>