[英]can we call a javascript function by clicking open button of browse of html?
Hi guys actually I want to call a function by clicking on open button of browse field of HTML.Is it possible,if yes then provide me information嗨,伙计们,实际上我想通过单击 HTML 浏览字段的打开按钮来调用 function。是否可能,如果是,请提供信息
No. The "Browse" button is not accessible via JS (neither is just the text field next to it).不可以。“浏览”按钮不能通过 JS 访问(也不是它旁边的文本字段)。
File uploads fields are very restricted not only regarding JS access - you cannot even style them properly.文件上传字段不仅在 JS 访问方面受到严格限制——您甚至无法正确设置它们的样式。
Basically there is restriction on browse button, but there is a solution by "onchange" event to call another js function.基本上浏览按钮有限制,但是有一个解决方案是通过“onchange”事件调用另一个js function。 And you can do as you want, eg: gmail file upload attachment, and shows all uploaded files and you can deselect each of them, so these type of js operation can be perform by OnChange method.....而且你可以做你想做的,例如:gmail文件上传附件,并显示所有上传的文件,你可以取消选择每个,所以这些类型的js操作可以通过OnChange方法进行......
and there is a lot of example to do work with browse button.并且有很多示例可以使用浏览按钮。 altering on type=file 改变类型=文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.