i want set value of input type if condition is true but my function not working. i write the correct code but dont know what wrong with it.
<head>
<script type="text/javascript">
function ghg(){
var fname= document.getElementById('jitender').value;
if(fname=="") {
fname= "i am value";
}
}
</script>
</head>
<body>
<input type="text" id="jitender" value="" />
<input type='button' value="submit" onclick="ghg()"/>
</body>