title: JQuery - Compare only a part of the text of all the options inside a select input, and select the one that matches
body: <p>I have the next select input:</p>
  
  <pre><code>&lt;h6&gt;Opciones: &lt;/h6&gt; 
  &lt;select id="id_opciones" name="elegir_opciones"&gt;
  &lt;option value="" selected="selected"&gt;---------&lt;/option&gt;
  &lt;option value="1"&gt;1-Primero-0 &lt;/option&gt;
  &lt;option value="2"&gt;2-Segundo-2000.00&lt;/option&gt;
  &lt;option value="3"&gt;3-Caja-0 &lt;/option&gt;
  &lt;option value="4"&gt;4-Tercero-4000.00&lt;/option&gt;
  &lt;option value="5"&gt;5-Cuarto-6000.00&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And also a variable that I get form a table, lets think that this is the variable:</p>
  
  <pre><code>var comparar=5000;
  </code></pre>
  
  <p>What I want to do is to compare the last value of the text inside the option, with the variable <code>comparar</code>, lets take the last item as an example:</p>
  
  <pre><code>&lt;option value="5"&gt;5-Cuarto-6000.00&lt;/option&gt;
  </code></pre>
  
  <p>The value that I want to compare to <code>comparar</code> is <code>6000.00</code> (I know how to get this value, with split), and do that with options 2, 4 and 5.</p>
  
  <p>The conditions will be something like this:</p>
  
  <pre><code>if (option2_value&lt;=comparar &amp;&amp; comparar&lt;option4_value){
    //select option 2
  }
  
  if (option4_value&lt;=comparar &amp;&amp; comparar&lt;option5_value){
    //select option 4
  }
  
  if (comparar&gt;=option5_value&gt;){
    //select option 5
  }
  </code></pre>
  
  <p>Probably the main question is, how to make a personalized selector for a select input?</p>