I have an html with the following code:
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>
What I want:
It is the href
Start.html only displayed when I press the submit "MANUAL" and it disappears only when I press the submit AUTOMATIC
What is happening: Because the entire page is set to update every second (This is how it should work), when I press MANUAL submit the whole page refreshes and the href appears for a moment and disappears.
Is there any way to "isolate" that part of the code when I press the submit
MANUAL? and that it only stops showing when I press%% AUTOMATIC%.