javascript - Change width of selectbox if no value -
can me please creating little script in jquery make select box width bigger when there no value? here code selectbox
<td class="value"> <select> <option value=""> select 1 </option> <option value="100-g" selected='selected'> 100 g </option> <option value="200-g" > 200 g </option> </select> </td>
and need make this: .summary table.variations .value { width: 300px; }
lot.
http://jsfiddle.net/oxydesign/2qn0d7rg/
js
$(document).ready(function(){ $('select').on('change',function(){ var select = $(this), cell = select.closest('td'); if(select.val()){ cell.removeclass('large'); }else{ cell.addclass('large'); } }); });
is want ?
Comments
Post a Comment