Earlier quoted context omitted.
True. Although whenever I see a jQuery plugin like that I try to replace it with some combination of "components" [1]. There is a lot of progress in that area. There are stuff like : File picker [2], dropdown [3], tip [4] for tooltips and many more. 1 : https://github.com/component 2 : https://github.com/component/file-picker 3 : https://github.com/component/dropdown 4 : http://component.github.io/tip/
The dropdown and tooltips look useful, but FYI it's really simple to make a file picker. Just put a hidden input type="file" on the page, then: document.getElementById("that-element").addEventListener("change", function(e) { // e.target.files }); document.getElementById("that-element").click();
document.getElementById("that-element").click();
doesn't exist. You need to use something like /** Creates the click on the input */
const clickEvent = document.createEvent( "MouseEvents" );
clickEvent.initEvent( "click", true, false );
document.getElementById("that-element").dispatchEvent( clickEvent );
References :1 : https://developer.mozilla.org/en-US/docs/Web/API/EventTarget...
2 : http://stackoverflow.com/questions/6367339/trigger-a-button-...
EDIT ( sorry can't reply to you, because HN ) :
Relevant jQuery discussion