Hi guys,
I have a textarea and I want to get the position of the cursor in the text area and want to insert some custom tags there.
I dont see caretPos working.
any help deeply appreciated.
insert an element at a particular position in text area
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
I am trying to select a textarea and get its contents which does not happen...why
I have seen in the examples how to move to a location; but how do i get the current position?
Code: Select all
<script>
var range = document.frmMessage.taMessage.createTextRange();
alert(range);
alert ("range text:" + range.text);
</script>
<form method="post" action="" name="frmMessage">
<textarea cols="50" rows="5" name="taMessage"></textarea>
</form>