Ver Mensaje Individual
  #9 (permalink)  
Antiguo 04/05/2010, 16:29
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 1 mes
Puntos: 20
Respuesta: Seleccionar / marcar elemento con JQUERY

Cita:
Iniciado por Dany_s Ver Mensaje
$('.activo').length
Gracias nuevamente :)

Código Javascript:
Ver original
  1. $(document).ready(function() {
  2.     $("li").click( function () {
  3.         $(this).toggleClass('activo');
  4.         var n = $('.activo').length;
  5.         $("span").text("Hay " + n + " elementos seleccionados");
  6.     });
  7. });