everything that happens here is nice and not crimes

Commit 8e5c2212 authored by Alexandra Catalina's avatar Alexandra Catalina 🎱

js: fix selectors

parent d1e1aa71
Pipeline #389 passed with stages
in 47 seconds
......@@ -17,12 +17,11 @@
// <http://www.gnu.org/licenses/>.
(function(){
var submit = document.getElementById('submit');
const submit = document.querySelector('input[type=submit]');
if (!submit) return;
submit.disabled = true;
var maxSize = document.getElementsByClassName('max-size');
const maxSize = document.querySelector('.max-size');
function checkSize(e) {
console.log(e.target.files);
......@@ -34,7 +33,8 @@
maxSize[0].classList.add('error');
}
}
var filepicker = document.getElementById('file');
const filepicker = document.querySelector('input[type=file]');
if (filepicker) {
filepicker.addEventListener('change', checkSize, false);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment