javascript oncut bug?
<p>In this code:</p>

<pre><code>&lt;!doctype html&gt;
&lt;body&gt;
&lt;input id="a"/&gt;
&lt;input id="b"/&gt;
&lt;script&gt;
var a=document.getElementById("a");
var b=document.getElementById("b");
a.addEventListener("cut",function(e){
    b.value=a.value;
    //the line above is not working as expected!
    //neither does this (as per tjm's answer): b.value=a.value.substr(0,a.selectionStart);
},true);

&lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p>When I do a cut in text-box-a, I want text-box-b to have the same value as text-box-a.. but it's not working. does anyone have any solution to this problem?</p>

<p>I need the solution to work in IE9.</p>

<p>(3 answers so far though none of them worked.. i can't believe we can't do this in javascript.. this is like one of the less-common-but-still-common stuff that we need ain't it?)</p>
