Tengo un html con el siguiente código:
function mostrar() {
var x = document.getElementById('alerta');
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
event.preventDefault();
}
#alerta {
margin-top: 1 0px;
display: none;
position: absolute;
}
#wrapper {
position: relative;
top: 0;
left: 0;
width: 100%;
}
<div class="wrapper">
<div id="alerta">
<a href="Start.htm">aparece con el submit MANUAL</a><br>
</div>
</div>
<div id="MANUAL">
<form method="post" action="">
<input type="submit" value="MANUAL" onclick="mostrar()">
<input type="hidden" name='"MANUAL"' size="20px" value="1">
<input type="hidden" name='"AUTOMATICO"' size="20px" value="0">
</form>
</div>
<td width="144px" height="21px">
<form method="post" action="">
<input type="submit" value="AUTOMATICO">
<input type="hidden" name='"AUTOMATICO"' size="20px" value="1">
<input type="hidden" name='"MANUAL"' size="20px" value="0">
</form>
</td>
Que es lo que quiero:
Es el href
Start.html solo se muestre cuando presiono el submit "MANUAL" y que desaparezca solo cuando presiono el submit AUTOMATICO
Que es lo que sucede: Debido a que la página completa esta configurada para actualizar cada segundo (Así debe trabajar), cuando presiono el submit MANUAL toda la página refresca y el href aparece por un instante y desaparece.
¿Hay alguna forma de "aislar" esa parte del código cuando presiono el submit
MANUAL? y que solamente se deje de mostrar cuando presiono el submit
AUTOMATICO.