javascript - Hiding input doesnt work -
<input type="checkbox" name="avatarfileselected" value="image" id="avatarfileselected" onclick="$('#extra').hide('slow')"/> <span style="color:#538f05;">change image</span> <div id="extra"> <input type="file" name="avatarfile" id="avatarfile"></input> </div>
the above code doesn't work. show me mistakes?
you didn't include jquery...
use vanilla javascript:
onclick="document.getelementbyid('extra').style.display = 'none'";
instead of:
onclick="$('#extra').hide('slow')"
(or include jquery if want use it.)
btw, <input>
doesn't have closing tag: </input>
replace:
<input type="file" name="avatarfile" id="avatarfile"></input>
with:
<input type="file" name="avatarfile" id="avatarfile" />
Comments
Post a Comment