How do I dynamically change size of select box depending on the number of responses retreived froma getJSON [code] $.getJSON("select.php", {project:"%" }, function(json){ var dropsize=json.length +2; var options = ""; options += '<option value="%">All Projects</option>'; for (var i = 0; i < json.length; i++) { options += '<option value="'+json[i]['project']+'">'+json[i] ['project']+'</option>'; } $("#select_project").html(options); [/code] now I want to set the select box to have a size=dropsize for example if the getJSON returned 8, dropsize=8 and the select would look like
<select id="select_project" name="select_project" size="8"> thanks K