
10.11.2005, 09:50
|
|
|
Контрибьютор базы знаний по Флекс
Регистрация: Aug 2005
Сообщений: 690
|
Нашел функцию mozwrap. Совсем запутался. Не подскажешь как ее на практике применить)
function mozWrap(txtarea, open, close)
{
var selLength = txtarea.textLength;
var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
if (selEnd == 1 || selEnd == 2)
selEnd = selLength;
var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
return;
}
|