Reputation: 637
I have a form with several selects (dropdown lists).
I want all of them to have max-width:300px, I tried this, but not working:
$(#myform 'select').css(width, '300px');
Upvotes: 0
Views: 100
Reputation: 10398
In jQuery it should be:
$('#myform select').css('max-width', '300px');
And pure CSS:
#myform select{
max-width:300px;
}
Upvotes: 2
Reputation: 28409
Your syntax is wrong
$('#myform select').css(width, '300px');
but in any case you would do this with pure CSS
#myform select{
width:300px;
}
Upvotes: 3