Someone help me with the below code I want to hide and show a div using input value using JavaScript.
<html>
<head>
<script>
function (){
document.getElementById('ref3').value;
if (value == 2) {
document.getElementById('div').style.visibility = 'visible';
} else {
document.getElementById('div').style.visibility = 'hidden';
}
}
</script>
</head>
<body>
<form name="myform">
<div><input type="text" id="ref3" value=""></div>
<div id="div" style="visibility:hidden">
<label>Show me</label>
</div>
</form>
</body>
</html>