Forum Moderators: open

Message Too Old, No Replies

IE execCommands

is there a way to add additional arguments to a tag?

         

httpwebwitch

8:10 pm on Mar 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using Internet Explorer execCommands to build an on-screen HTML editor. I am using the built-in commands as defined here:
h**p://msdn.microsoft.com/workshop/author/dhtml/reference/commandids.asp

In particular, the "CreateLink" command inserts a hyperlink on the current selection by activating a dialog box. The dialog box (which is part of IE, not controlled by my script) allows me to set the URL. What if I also want to set the "target"?

Is there another execCommand that lets me put more attributes into an existing tag?

Sticky me if you have ANY experience using execCommands! thanks.

RonPK

2:12 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Is there another execCommand that lets me put more attributes into an existing tag?

Not that I know of. I once built my own little href-tag-creator: a popup window with fields for target, title, class, id et cetera. Onsubmit the values are passed to a function that pastes them into a nice string, which is pasted around the selected text. Not that hard if you know a little Javascript.

DrDoc

4:05 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You don't need to use execCommand for that at all...
Just use setAttribute().