![]() |
|
|
+ Search |
![]()
|
Apr 5th, 2008 20:48
ha mo, Gunnar Liljas, Neil Hardie, Andy Maurer,
Here's a little function I just came up with.
function caretPos(textEl)
{
var i=textEl.value.length+1;
if (textEl.createTextRange)
{
theCaret = document.selection.createRange
().duplicate();
while (theCaret.parentElement()==textEl &&
theCaret.move("character",1)==1) --i;
return i;
}
else return -1;
}
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com