title: Java set maximum and minimum value of the textbox according to the option selected from dropdown menu
body: <p>This is my html code:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function Check(e) {
    var text=document.getElementById(&quot;text&quot;);
    var inputnum = document.getElementById(&quot;number&quot;);
    if (e.value == &quot;option1&quot;) {
      inputnum.min = &quot;5&quot;;
      inputnum.max = &quot;10&quot;;
      text.innerHTML =&quot;input the value from 5 to 10&quot;;
    } else if (e.value == &quot;option2&quot;) {
      inputnum.min = &quot;20&quot;;
      inputnum.max = &quot;30&quot;;
      text.innerHTML =&quot;input the value from 20 to 30&quot;;
    }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;select id=&quot;selectMe&quot; onChange=&quot;Check(this);&quot;&gt;
     &lt;option value=&quot;&quot;&gt;&lt;/option&gt;
      &lt;option value=&quot;option1&quot;&gt;option1&lt;/option&gt;
      &lt;option value=&quot;option2&quot;&gt;option2&lt;/option&gt;
  &lt;/select&gt;
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;input name=&quot;number&quot; type= &quot;number&quot; id=&quot;number&quot;&gt;
  &lt;p id=&quot;text&quot;&gt;&lt;/p&gt;
  &lt;/input&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  <p>I need little modification in this code which sets the minimum and maximum value of the number input box as per the option selected from drop down.</p>
  <p>For eg: If user selects option1 then the minimum value must be 5 and maximum most be 10. Similarly If user selects option2 then the minimum value must be 10 and maximum most be 20. And it also should show the message (inside html below the text box (not as alert message) showing please input the value from xxx to xxx</p>
  <p>Please help me with this. thankyou in advance.</p>