Prevent multiple selection of a div
<p>I have multiple divs on my page.I want to copy selected text from div1 to div2 only.Selection on div2, div3, div4 should not get copied. If ctrl+A is pressed or multiple divs are selected at a time, copy should not happen.</p>

<pre><code>//Validation for including text only from specified div

$('#DocumentText').mouseup(function (e) {
    debugger;
    isSelected = true;
    flaginclude = 1;

    // e.stopPropagation();
});

$(document).mouseup(function (e) {
    debugger;

    if (flaginclude != 1) {
        e.stopImmediatePropagation();
        isSelected = false;
    }
    flaginclude = 0;
});

myfunction()
{
 if(isSelected)
 {
   //logic to append selected text on div2
 }
}
</code></pre>
