Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/10/2015, 10:20
dune1993
 
Fecha de Ingreso: octubre-2015
Mensajes: 29
Antigüedad: 8 años, 6 meses
Puntos: 0
Respuesta: ocultar/mostrar boton

Cita:
Iniciado por omarMusic Ver Mensaje
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <meta charset="UTF-8">
  4.     <title>boton</title>
  5. </head>
  6.     <input type="button" id="btn-1" value="Botón 1" onclick="mostrarBoton()"/>
  7.     <input type="button" id="btn-2" value="Botón 2" style="display: none;"/>
  8.  
  9.     <script>
  10.         var btn_1 = document.getElementById('btn-1');
  11.         var btn_2 = document.getElementById('btn-2');
  12.        
  13.         function mostrarBoton () {
  14.             btn_1.style.display = 'none';
  15.             btn_2.style.display = 'inline';
  16.         }
  17.     </script>
  18. </body>
  19. </html>

mmm... aunque esto me parece una tarea D: la idea es que muestres tus avances y acá te ayuden con tus dudas.

Saludos!
Hola mira,
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("dt").hide();
});
$("#show").click(function(){
$("dt").show();
});
});
getElementById("parteOpcional").style.display = "none"; // Ocultar
</script>





mi html:


<dt>
<div data-role="fieldcontain" class="relojes" >
<a href="#" data-role="button" data-theme="a" id="hide" onclick="ActivarReloj()" data-inline="true" value="INICIO"><img src="imagenes/icono-iniciar-nuevo.png" height="75" width="75" ></a>
</div></dt>

<div data-role="fieldcontain" class="relojes" >
<a href="#dialogo" data-role="button" data-rel="popup" data-theme="a" data-inline="true" data-position-to="window" data-transition="turn"><img src ="imagenes/icono-cerrar-nuevo.png" height="75" width="75" ></a>

<div data-role="popup" id="dialogo" data-theme="b" data-dismissible="false">
<div class="ui-content">
<strong>Vas a TERMINAR el tiempo en esta OT</strong>

<a href="" data-role="button" data-rel="back" data-inline="false" style="background:#be1622"> <strong>NO</strong></a>
<a href="" data-role="button" data-rel="back" onclick="ActivarReloj2()" id="botonActivar2" value="FIN" data-inline="false" style="background:#3aaa35">
<strong>SI</strong></a>
</div> </div></div>



(ignora lo que no viene al caso jeje) entonces he consegido que me salgan los 2 botones y al pulsar iniciar, este me desaparece y solo me deja el de cerrar, hasta ahi bien pero me falta que desde un principio me salga solo el de iniciar.
Resumiendo: un boton que al pulsarle aparezca otro y despues de pulsarlo tambien que desaparezca.