How to copy a text with the html layout with Firefox and IE7?

How to copy a text with the html layout with Firefox and IE7?

Hello,

So what I want to do is to be able to copy a content of a div with his complete layout.
Right now I'm able to copy the text and the layout in firefox but not with internet explorer.
The function copyToClipboard is working correctly I think the problème should be with the attributes I'm using to select what I want to copy: .clone().text()
Does someone have an idea?

Here is my actual code (without the copy to clipboard script, I can add it if you think it could help but I don't think so).

  1. <div id="mailtest" style="width:540px;">Bonjour,<br/>
    Merci pour votre demande<br/>
    Dans le cadre de votre question, et après vérifications auprès de nos techniciens,<br/>
    Si des questions subsistent, nous vous invitons a contacter notre service technique afin qu'un de nos techniciens vous répondent le plus précisément possible.<br/>
    Cordialement,<br/>
    <label class="namewrite"></label><br/>
    Service clients.
    </div>
    <a onclick='return copyToClipboard($("#mailtest").clone().text());' href="#"><img src="./img/page_white_copy.png" alt="copy to clipboard" title="Copy to Clipboard" /></a>