javascript - Stop dropdown width from expanding -


I have two dynamic dropdown lists depending on whether the option displayed on the second dropdown is selected in the first dropdown. There are 2 options in the first dropdown. If the second option is selected, the values ​​displayed on the second dropdown in the response are very long strings (be exact URL). Is there a way that I can stop the width of the dropdown in detail?

Here JSFiddle results are:

  & lt; Select id = "kategorie_oder_seite" & gt; & Lt; / Select & gt; & Lt; Select ID = "auswahl" & gt; & Lt; / Select & gt; Var data = {"category": ["craft", "starship", "insurance", "risk",], "site": ["http://jsfiddle.net/tony089/pgbw56vb/2/", " Https://stackoverflow.com/users/login?returnurl=%2fquestions%2fask "],}; Var $ kategorien = $ ("# kategorie_oder_seite") ("Change", function () {var seiten = $ .map (data [this.value], function (seite) {return $ ("& lt; option / & gt;"). Text (seat);}) ; $ ("# Auswahl") blank (). Append (sitten);}); (Different categories in data) {$ ("& lt; option />").text(kategorie).appendTo($kategorien); } $ Kategorien.change ();  

Thanks in advance.

You can add a fixed width as #auswahl id as the following Choose from:

CSS:

  #auswahl {width: 200px; }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -