KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Let's say I have some HTML code like this: <body contentEditable="true"> <h1>Some heading text here</h1> <p>Some text here</p> </body> Now the caret (the blinking cursor) is blinking inside the <h1> element, let's say in the word "|heading" . How can I get the element the caret is in with JavaScript? Here I would like to get node name: "h1" . This needs to work only in WebKit (it's embedded in an application). It should preferably also work for selections.
Tags (comma-separated)
Save Edits
Cancel