test custom select option

by QMaster

HTML

<span style="font-size:16px;">
<span style="font-family:arial,helvetica,sans-serif;">

<select id="resizingSelectTag">

      <option>All</option>

       <option>Lorem Ipsum</option>

       <option>Lorem Ipsum is not simply random text.</option>

</select>

<select id="selectTagWidth">

       <option id="widthTempOption"></option>

</select>

</span></span>

CSS

#resizingSelectTag {
 width: 50px;
}
  
#selectTagWidth{
 display : none;
}

JavaScript

$(document).ready(function() {
$('#resizingSelectTag').change(function(){
    $("#widthTempOption").html($('#resizingSelectTag option:selected').text());
    $(this).width($("#selectTagWidth").width()); 
 });
});