Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 views
in Technique[技术] by (71.8m points)

javascript - 文件上传时如何编辑CSS(How to edit css when file is uploaded)

I have a form where users can upload a file.(我有一个表单,用户可以在其中上传文件。)

The uploading and validation afterwards (filesize, filetype...) is done with php by submitting.(之后,上传和验证(文件大小,文件类型...)是通过php通过提交完成的。) But I wonder how I could give the user a "visual feedback" that his file was "picked" immediately.(但是我不知道如何给用户一个“视觉反馈”,即他的文件被“挑选”。) So I don't need validation nor anything complex.(因此,我不需要验证,也不需要任何复杂的操作。) I just want to either color the label green or rename the label of the upload field when the user has selected a file and clicked "Choose" in his browser.(当用户选择文件并在浏览器中单击“选择”时,我只想为标签涂上绿色或重命名上载字段的标签。) How would I do that most easily?(我将如何最轻松地做到这一点?)   ask by Daiaiai translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

成功后,分配一个变量,然后使用该变量将类添加到元素。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...