Welcome Guest Search | Active Topics | Sign In | Register

HTML Editor - HTML Selection Options
Intsoft
Posted: Wednesday, September 9, 2009 12:40:06 PM
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
eo_support
Posted: Wednesday, September 9, 2009 12:48:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Can you explain what do you mean by "Html selection"?

Thanks!
Intsoft
Posted: Thursday, September 10, 2009 3:00:52 AM
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
eo_support
Posted: Thursday, September 10, 2009 9:30:24 AM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.