Hello!

The javascript code below works like this:

When you run it on I.E, I use mouse to highlight the bold text "Highlight Me Now" and click button "Test" - I see the alert box "<B>Highlight Me Now</B>" .

But in FireFox browser, it shows the alert "Highlight Me Now" without tag <B></B>. How to make FireFox grab the HTML tag <B></B> like the way IE browser did?

Here is my code
HTML Code:
<script>
function GETSELECTION(){
    if(document.all){
        var selection = document.selection;
        var newRng = selection.createRange();
        newRng.select();
        html_selection=newRng.htmlText;
        alert(html_selection);
    }
    else{
        var html_selection = document.getSelection();
        alert(html_selection);
    }
}
</script>
<p><b>Highlight Me Now</b></p>
<input onclick="GETSELECTION();" type="button" value="Test">
Thanks