Código Javascript:
En este link dejo una explicacion de esto:Ver original
$(".color").on("load", function(e) { $("#color").msDropdown({visibleRows:5}); });
http://www.arumeinformatica.es/blog/...dinamicamente/
Código HTML:
Ver original
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> window.onload = function() { $("#fff").on("click", function() { $('<select name="color" id="color" data-usesprite="smallIcons" style="width:130px; float: left; margin-right: 10px;"><option value="0" selected="selected">Color</option><option value="1" class="rojo">Rojo</option><option value="2" class="naranja">Naranja</option><option value="3" class="amarillo">Amarillo</option><option value="4" class="verde">Verde</option><option value="5" class="agua">Agua</option><option value="6" class="azul">Azul</option></select>').appendTo('#pp'); /*$(".color").on("load", function(e) { $("#color").msDropdown({visibleRows:5}); });*/ return false; }); } $(document).ready(function(e) { $("#color").msDropdown({visibleRows:5}); }); </script> </head> <body> <form class="international" method="post" action="<?php $PHP_SELF ?>" id="form-join" name="addmerc"> <div id="pp" style="width: 920px;"> <select name="color" id="color" data-usesprite="smallIcons" tabindex="-1"> </select> </div> </form> </body> </html>
De aca se descarga ms-Dropdown
https://github.com/marghoobsuleman/ms-Dropdown