web前端|js教程
光标位置,插入值
web前端-js教程
业务下单源码,vscode更改代码风格,Ubuntu网桥搭建,tomcat 黑框,安卓sqlite存放位置,前端开发的框架是干嘛用的,爬虫定时抓取数据并时时显示,php 数组 反转,网店推广实战seo,dsoframer 网站,有趣的特效网页代码,模板安装lzw
/**
*往输入域中插入字符串(光标所在位置)
*@param $t document.getElementById(fieldId)
*@param myValue 要插入的值
**
function addSplitToField($t,myValue){
if (document.selection) {
$t.focus();
sel = document.selection.createRange();
sel.text = myValue;
$t.focus();
}else if($t.selectionStart || $t.selectionStart == ) {
var startPos = $t.selectionStart;
var endPos = $t.selectionEnd;
var scrollTop = $t.scrollTop;
$t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length);
this.focus();
$t.selectionStart = startPos + myValue.length;
$t.selectionEnd = startPos + myValue.length;
$t.scrollTop = scrollTop;
}else{
$t.value += myValue;
$t.focus();
}
}
游戏网站源码带采集,必须用ubuntu吗,京东商品监控爬虫,php swaitch,简阳seo服务lzw