
HTLM5 MOSTRAY Y OCULTAR
Publicado por asiole (2 intervenciones) el 23/07/2017 13:55:44
Tengo estos códigos para MOSTRAR y OCULTAR preguntas y respuestas.
¿cómo puedo poner un color al [-] y otro a `[+]?
¿Cómo puedo cambiar estos signos por iconos?
¿cómo puedo poner un color al [-] y otro a `[+]?
¿Cómo puedo cambiar estos signos por iconos?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<script>
function mostrar(enla , etik) {
obj = document.getElementById(etik);
obj.style.display = (obj.style.display == 'block') ? 'none' : 'block';
enla.innerHTML = (enla.innerHTML == '[-]') ? '[+]' : '[-]';
}
</script>
</head>
<body>
<!--<div>PRIMERA PREGUNTA</div>-->
<p><a href="#" onclick=mostrar(this,'oculto'); return false" />[+]</a>1ª</p>
<div id="oculto" style="display:none" span class="ms-rteThemeForeColor-9-3">
PRIMERO
</div>
<!--<div>SEGUNDA PREGUNTA</div>-->
<p><a href="#" onclick="mostrar(this,'oculto2'); return false" />[+]</a>2ª </p>
<div id="oculto2" style="display:none" span class="ms-rteThemeForeColor-9-3">
SEGUNDO
</div>
<!--<div>TERCERA PREGUNTA</div>-->
<p><a href="#" onclick="mostrar(this,'oculto3'); return false" />[+]</a>3ª</p>
<div id="oculto3" style="display:none" span class="ms-rteThemeForeColor-9-3">
TERCERO
</div>
</body>
</html>
Valora esta pregunta


-1