/    Sign up×
Community /Pin to ProfileBookmark

How can i detect the cursor position insid of an editable DIV?

well im currently making a wysywig editor with javasript, what i have is 2 editors in one sort of, one is the WYSYWIG and the other is the hard code html. all i need to know is how i can identify where the blinking cursor is inside of my WYZYWIG editor, i tried using caretPos but unfortunatly i cant use that with the getElementById()funciton, lol so pleae if you could help me hat would be great, if you need to see my code id be glad to show it to you, its a liitle messy lol i was planning on going back and fixing it up once i was done. but anyway thanx for readin gthis pot, would be great if you could help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@danielnycJul 06.2007 — can detect cursor position in text field using javascript?

ie i have a text field that will have codes in it like

303.8765.9876

(1)i need to be able to detect that the cursor in the '8765' area or the '9876'

(2) then based on position, display some related information in another div layer

I need help with (1). is this possible please?

ideas strongly welcomed & appreciated?

Daniel
×

Success!

Help @stoodder spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...