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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -