I'm trying to show a modal dialog that I created with css on the click of an anchor element, and hide it on click of another element within the dialog box.
I have tried finding reasons for why it doesn't work, but I cannot find it...I'm sure it's a very obvious reason that I should have caught..... I'd appreciate any help or advise.
JavaScript:
function show(target) {
document.getElementById(target).style.visibility = 'block';
}
function hide(target) {
document.getElementById(target).style.display = 'none';
}
HTML:
<a id="as" href="#" onclick="show('modalDialog')">Open Modal Box</a>
<div id="modalDialog">
<div> <a href="#" title="Close" class="close" onclick="hide('modalDialog')">X</a>
<h2>Modalo Box</h2>
<p>test</p>
</div>
</div>