|
Rank: Newbie Groups: Member
Joined: 9/15/2008 Posts: 3
|
Hi, I have a simple question but a little bit difficult to implement : I'm not able to get Html selection, just text selection in HTML editor.
Have you an idea ? Thanks Steph
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Can you explain what do you mean by "Html selection"?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/15/2008 Posts: 3
|
Ok, in the HTML editor, I have this test in Design Mode :
This is a test !
But in Html, I have this :
<a href="http://www.google.ch">This is a test !</a>
My question is: I have a method (editor.getSelection()) to get the text selection in the editor ; how can I get the equivalent HTML ? the goal is getting the current link value in the html tag.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can try to use editor.getCurrentElement() to get the current node. Then walk through node.parentNode until you find your link element. From there you can the the link value.
Thanks!
|
|