If file is selected show h1
div else hide it. Maybe I have gone absolutely the wrong way in terms of calling alert()
.
<script type="text/javascript">
function foo() {
var f = document.getElementById("f1");
var h = document.getElementById("h1");
alert( ""==f.value ? " f == nothing selected" : "f = file selected");
alert( ""==h.value ? " h == nothing selected" : "h = file selected");
if(alert( ""==f.value "f = file selected"){
$('#h1').show();
}else{
$('#h1').hide();
}
}
</script>
<style type="text/css">
#h1{
display:none;
}
</style>
<input id="f1" type="file">
<input id="h1" type="file">