If this container is a div (it probably works for an iframe too) then you can then cycle through the pasted content using normal dom methods, or get it as a string using innerHTML. You can then restore the previous contents of the div, and insert whatever content you like.