---
title: "在textarea指定位置插入字符串"
author: "legend9999"
date: "2012-01-10T15:58:04Z"
tags: ["textarea"]
categories: ["Web前端"]
slug: "textarea"
draft: false
lastmod: "2012-01-10T15:58:04Z"
id: 1340210
url: "https://legend9999.iteye.com/blog/1340210"
---

在textarea中插入obj


```java
function editSMS(id,obj){
	var smsContent_tmp=document.getElementById("smsContent_tmp");
	smsContent_tmp.focus(); 
	document.selection.createRange().text=obj.value;   
}

```