i m using a hyperlink here and on click event of the hyperlink i want to copy the selected text (which i have selected using the mouse pointer or highlighted text) inside the text box using the java script i want only selected text in the text box which i select or highlight from mouse pointer.my java script is working but it copy the full text of div
<li><a href="#" onclick="JAVASCRIPT:return Edit();">Candidate Name</a> </li>
<script type="text/javascript">
    function Edit() {
        alert("hiii");
        document.getElementById('<%=txtbox.ClientID%>').value = document.getElementById('<%=divtext.ClientID%>').innerHTML;
         return true;
    }
</script>
<div>
    <asp:TextBox ID="txtbox" runat="server"></asp:TextBox>
</div>
<div id="divtext" runat="server">
    TCS Infosys Wipro HP HCL Microsoft Facebook Facebook Facebook 
</div>
 
    