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

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -