(30 июл 2014, 23:58) (
1/
0)
[
1]
<?
<script language="JavaScript" type="text/javascript">
function tag(text1, text2) {
if ((document.selection)) {
document.form.name.focus();
document.form.document.selection.createRange().text = text1+document.form.document.selection.createRange().text+text2;
} else if(document.forms['form'].elements['name'].selectionStart!=undefined) {
var element = document.forms['form'].elements['name'];
var str = element.value;
var start = element.selectionStart;
var length = element.selectionEnd - element.selectionStart;
element.value = str.substr(0, start) + text1 + str.substr(start, length) + text2 + str.substr(start + length);
} else document.form.name.value +=text2;
}
</script>
?>
попробуй