执行此操作的常规方法是:
var resultSelect = document.getElementById("resultSelect");
resultSelect.size = 3;
我如何在jQuery中执行此操作?
答案 0 :(得分:2)
类似的东西:
$("#resultSelect").attr('size', '3');
答案 1 :(得分:2)
$('#mySelect').attr('size', value)
Using jQuery, how can I dynamically set the size attribute of a select box?