So I want to hide an input in a function. Here's what I already have:
function doGetWord() {
var word = F.gword.value;
var wLength = word.length;
for (var i = 0; i < wLength; i++) {
document.getElementById("dword").innerHTML += "_ "
}
$(document).ready(function() {
$("input.cclick").click(function() {
$("input.cword").hide();
});
});
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form name="F">
<input type="text" name="gword" class="cword">
<!--<input type="text" name="t" class="in2">-->
<input type="button" name="b" value="do" onclick="doGetWord()" class="cclick">
<div id="dword"></div>
</form>
But it doesn't seem to hide it.
Thanks in advance.