jQuery 如何更改选择框的宽度
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5645079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 19:33:50 来源:igfitidea点击:
How to change the width of select box
提问by jai
How to change the width of select box in jquery or in html?
如何在jquery或html中更改选择框的宽度?
回答by PHP
In HTML
在 HTML 中
<select name="foo" style="width:30px;">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
In Jquery
在jQuery中
$('#Id').width(30);