我想点击input选中里面的value,再点一下可以编辑
- JScript code
function oldUserBuyClick(){ var customer = $(this); customer.select() }
可在ie下点击input一直处在选中状态,除非都删了。
请高手指点下
用过unbind("click"), 不好使
------解决方案--------------------
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;
}
------解决方案--------------------
不要想得太复杂了。
- HTML code
<input type="text" name="" value="123" id="input" onfocus="this.select()" />