Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
In a project i want to make a list box to change its size according to the data inserted in the list box. if any body know help me.using(asp.net,c#)
Posted

The Select tag automatically sets its size depends on Options length, if you donot Specify the Width of the Selection tag in Style Property,

HTML
<select id="Select" ></select>

and insert options from javascript(Jquery)
JavaScript
$("#Select").append("<option value='"+city+"'>"+city+"</option>");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900