我想点击input选中里面的value,再点一下可以编辑 function oldUserBuyClick(){
  var customer = $(this);
  customer.select()
}可在ie下点击input一直处在选中状态,除非都删了。
请高手指点下用过unbind("click"), 不好使

解决方案 »

  1.   

    代码有问题吧,this是谁呢?,你得传参数吧
      

  2.   

    我重新发个html吧
    这个不直观<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>无标题</title>
    </head>
    <body>
    <input type="text" name="" value="" id="input" onclick="oldUserBuyClick()">
    <script type="text/javascript" language="javascript" >function oldUserBuyClick(){
      var customer = document.getElementById('input');
      customer.select()
    }
    </script>
    </body>
    </html>
      

  3.   

    设个全局变量,第一次点击设置readonly属性 ;第二次移除readonly属性
      

  4.   

    function oldUserBuyClick(){
      var customer = document.getElementById('input');
      customer.select()
    }
    这个地方做个判断,
    function oldUserBuyClick(){
      var customer = document.getElementById('input');
      if(!this.selected){
        customer.select();
        this.selected=true;
    }else{
        this.selected=false;
    }
      

  5.   

    不要想得太复杂了。<input type="text" name="" value="123" id="input" onfocus="this.select()" />
      

  6.   

    要编辑文本框必须聚焦,这点认同6楼!必须还得focus
      

  7.   

    如何选择标签span中的文本了,类似input标签的select效果?