
jQuery mostrar unos números y seleccionar únicamente los impares
Publicado por Eider (5 intervenciones) el 23/02/2016 14:37:11
¡Hola! Este es mi código y no funciona. ¿Alguien me puede ayudar? Gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE HTML>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
var resultado
$("button").click(function(){
resultado = $( "li:odd" );
});
</script>
</head>
<body>
<ul>
<li>0</li>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
<button>Ver resultado</button>
</body>
</html>
Valora esta pregunta


0