title: jquery get id of input selected text
body: <p>I have several <code>input</code> fields (sometimes disabled). When the user clicks a button, how can I get the <code>id</code> of the <code>input</code> field that has text <em>selected</em> in it?</p>
  
  <pre><code>Text:&lt;input type="text" id="myID" disabled="disabled" value="Hello World"/&gt;
  &lt;input type="text" id="myID2" value="Hello again"/&gt;
  &lt;input type="button" id="myButton" value="Get Selected Id" name="Get Selected Id"/&gt;
  
  $("#myButton").click(function(){
      alert(/*...how do I get 'myID' or 'myID2' here, depending on which has a selection?...*/);
  });
  </code></pre>
  
  <p>By "selected" I mean like this:</p>
  
  <p><img src="https://i.stack.imgur.com/paEy3.jpg" alt="enter image description here"></p>
  
  <p>Here's the <a href="http://jsfiddle.net/39x0cc6d/2/" rel="nofollow noreferrer">fiddle</a> </p>
  
  <p>Unfortunately, I need to support not just modern browsers, but also IE7 and IE8.</p>