<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head><script type="text/javascript">
</script>
<body>
<input type="text" value="qq.com" id="input" />
<script type="text/javascript">
$(function(){
$("#input").click(function(){
var obj = document.getElementById("input");
obj.value = obj.value;
obj.focus();
var len = obj.value.length;
if (document.selection) {
var sel = obj.createTextRange();
sel.moveStart('character', 0);
sel.collapse();
sel.select();
} else if (typeof obj.selectionStart == 'number'
&& typeof obj.selectionEnd == 'number') {
obj.selectionStart = obj.selectionEnd = 0;
}
})
})
</script>
</body>
</html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head><script type="text/javascript">
</script>
<body>
<input type="text" value="qq.com" id="input" />
<script type="text/javascript">
$(function(){
$("#input").click(function(){
var obj = document.getElementById("input");
obj.value = obj.value;
obj.focus();
var len = obj.value.length;
if (document.selection) {
var sel = obj.createTextRange();
sel.moveStart('character', 0);
sel.collapse();
sel.select();
} else if (typeof obj.selectionStart == 'number'
&& typeof obj.selectionEnd == 'number') {
obj.selectionStart = obj.selectionEnd = 0;
}
})
})
</script>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货