Foros del Web » Programando para Internet » Javascript » Frameworks JS »

No puedo agregar mas items a una lista

Estas en el tema de No puedo agregar mas items a una lista en el foro de Frameworks JS en Foros del Web. Hola. Tengo el siguiente código: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original $(function() {     var lifilter=$("#filter li:first").clone();     $("#baddfilter").click(function(){         ...
  #1 (permalink)  
Antiguo 13/04/2011, 16:43
Avatar de chicohot20  
Fecha de Ingreso: mayo-2009
Mensajes: 388
Antigüedad: 14 años, 10 meses
Puntos: 43
No puedo agregar mas items a una lista

Hola. Tengo el siguiente código:

Código HTML:
Ver original
  1. $(function() {
  2.     var lifilter=$("#filter li:first").clone();
  3.     $("#baddfilter").click(function(){
  4.         lifilter.appendTo("#filter");
  5.     });
  6. });
  7.  
  8.  
  9. <ol id='filter'>
  10. <li>
  11. <option>0001</option>
  12. </li>
  13. </ol>
  14. <a href="#0" id='baddfilter'>Agregar filtro</a>

Y sólo me permite agregar un item, quisiera que se agreguen ilimitadamente, gracias.
  #2 (permalink)  
Antiguo 15/04/2011, 05:37
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 4 meses
Puntos: 65
Respuesta: No puedo agregar mas items a una lista

Código HTML:
Ver original
  1.     <head>
  2.         <title>Ejemplo</title>
  3.         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  4.         <script>
  5.  
  6. $( function(){
  7.  
  8.     var lifilter = $('#filter').html() ;
  9.     $("#baddfilter").click(function(){
  10.         $("#filter").append(lifilter);
  11.         return false;
  12.     });
  13.  
  14. });
  15.     </script>
  16.  
  17.     <style>
  18.  
  19.     </style>
  20.  
  21. </head>
  22.  
  23. <ol id='filter'>
  24.     <li>
  25.         <select>
  26.             <option>0001</option>
  27.         </select>
  28.         <select>
  29.             <option>M</option>
  30.         </select>
  31.     </li>
  32. </ol>
  33. <a href="#0" id='baddfilter'>Agregar filtro</a>
  34.  
  35. </body>
  36. </html>

Etiquetas: items, lista
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:09.