___ ___ erkimt Adding links in a 'select' and change the width of the box 'select' before the click ______ qstntxt ___

I tried to add a reference of a link in an item from a 'select' list "number 2" and it was not possible, what solution should I join to link this item ?? and it is also not possible to increase the width of the 'select' box before the click,?

%pre% %pre%
    
______ azszpr305635 ___

You can not use tags in% s of% s. First, to increase the height of %code% , you can use %code% instead of %code% , so that the box increases before the click. E %code% instead of %code% to return to normal.

Second, you can put the URL in %code% of %code% and %code% redirect with %code% by taking its value from %code% selected:

%pre% %pre%
    
___

1

I tried to add a reference of a link in an item from a 'select' list "number 2" and it was not possible, what solution should I join to link this item ?? and it is also not possible to increase the width of the 'select' box before the click,?

option:hover{ background-color: #ff0; }
select option{ width: 200px; }
<form>

<select id="ctg" class="dt" name="select1" onmousedown="if(this.options.length>8){this.size=8;}"  onchange='this.size=0;' onblur="this.size=0;">
             
             <option value="1"> number 1</option>
             <option value="2"> <a href="https://c1.staticflickr.com/6/5005/5372580945_2988198c90.jpg">number 2</a></option>
             <option value="3"> number 3</option>
             <option value="4"> number 4</option>
             <option value="5"> number 5</option>
             <option value="6"> number 6</option>
             <option value="7"> number 7</option>
             <option value="8"> number 8</option>
             <option value="9"> number 9</option>
             
           </select>
</form>
    
asked by anonymous 09.06.2018 / 02:27

1 answer

1

You can not use tags in% s of% s. First, to increase the height of option , you can use select instead of onmouseover , so that the box increases before the click. E onmousedown instead of onmouseleave to return to normal.

Second, you can put the URL in onblur of value and option redirect with onchange by taking its value from location.href selected:

option:hover{ background-color: #ff0; }
select option{ width: 200px; }
<form>
  Selecione "number 2":
  <br>
   <select id="ctg" class="dt" name="select1" onmouseover="if(this.options.length>8){this.size=8;}"  onchange='location.href=this.value' onmouseleave="this.size=0;">
                
      <option value="URL_aqui"> number 1</option>
      <option value="https://c1.staticflickr.com/6/5005/5372580945_2988198c90.jpg">number 2</option>
      <option value="URL_aqui"> number 3</option>
      <option value="URL_aqui"> number 4</option>
      <option value="URL_aqui"> number 5</option>
      <option value="URL_aqui"> number 6</option>
      <option value="URL_aqui"> number 7</option>
      <option value="URL_aqui"> number 8</option>
      <option value="URL_aqui"> number 9</option>
   
   </select>
</form>
    
09.06.2018 / 02:53