Problem of GetSelection() in IE

  •  10-22-2008, 2:30 PM

    Problem of GetSelection() in IE

    i want to run this code in IE, it is working fine in Firefox.
     
    Code:- 
    var e1 = document.getElementById('<% =Editor1.ClientID%>');
     
    var selectedDiv = e1.GetSelection();
     
    selectedDiv.anchorNode.parentNode.innerHTML = '<b>' + selectedDiv.anchorNode.parentNode.innerHTML + '</b>'
     
     
     
    Somehow in IE, selectedDiv.anchorNode is keep coming as undefined. Please provide me the alternative code.
     
    I tried the sample code given at http://cutesoft.net/forums/thread/37318.aspx, but it didn't work.

    Thanks
    Karan

    Karan Singh
    (Web Developer)
View Complete Thread