Results 1 to 2 of 2

Thread: execCommand

  1. #1
    Join Date
    Dec 1969

    Default execCommand

    does anyone know how to get a reference to an IMG inserted using the document.execCommand("insertImage") method? I am trying to insert an image and then set its id, but the execcommand function only returns a boolean value.

  2. #2
    Join Date
    Dec 1969

    Default well it's not ideal but...

    As nobody else can think of anything, i might as well venture this possible solution. If we could assume that all the images currently in your document already have an ID except the new one, you could loop through documents.images with javascript and test to see if each image has an id. If it doesn&#039;t, give it one. Is this feasible for your situation?<BR>for (i=0;i&#060;document.images.length;i++){<BR>if (document.images[i].id.length&#060;1){document.images[i].id="newImageID"}}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts