html5中文学习网

您的位置: 首页 > 网页制作 > html教程 » 正文

如何点击a标签实现弹出input file上传文件对话框_HTML/Xhtml_网页制作

[ ] 已经帮助:人解决问题
点评:点击a标签实现弹出input file上传文件对话框,html、css、如下感兴趣的朋友可以参考下哈,希望对你有所帮助
html XYLHTML5中文学习网 - HTML5先行者学习网

复制代码
代码如下:
XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=tag><<SPAN class=title>div</SPAN>></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=tag><<SPAN class=title>a</SPAN> <SPAN class=attribute>href</SPAN>=<SPAN class=value>"###"</SPAN>></SPAN>添加图片<SPAN class=tag></<SPAN class=title>a</SPAN>></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=tag><<SPAN class=title>input</SPAN> <SPAN class=attribute>type</SPAN>=<SPAN class=value>"file"</SPAN> <SPAN class=attribute>name</SPAN>=<SPAN class=value>"image"</SPAN> <SPAN class=attribute>class</SPAN>=<SPAN class=value>"hidden"</SPAN> <SPAN class=attribute>value</SPAN>=<SPAN class=value>""</SPAN> /></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=tag></<SPAN class=title>div</SPAN>></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
XYLHTML5中文学习网 - HTML5先行者学习网
css XYLHTML5中文学习网 - HTML5先行者学习网

复制代码
代码如下:
XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=class>.hidden</SPAN> <SPAN class=rules>{ XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=rule><SPAN class=attribute>display</SPAN>:<SPAN class=value> none;</SPAN></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
<SPAN class=rule>}</SPAN></SPAN> XYLHTML5中文学习网 - HTML5先行者学习网
XYLHTML5中文学习网 - HTML5先行者学习网

复制代码
代码如下:
XYLHTML5中文学习网 - HTML5先行者学习网
jquery XYLHTML5中文学习网 - HTML5先行者学习网
$('a').on('click', function(e) { XYLHTML5中文学习网 - HTML5先行者学习网
e.preventDefault(); XYLHTML5中文学习网 - HTML5先行者学习网
$(this).closest('input[type=file]').trigger('click'); XYLHTML5中文学习网 - HTML5先行者学习网
}) XYLHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助