Learn to Code via Tutorials on Repl.it!

← Back to all posts
How To Make An Upload Button
matthewproskils (460)

Simple Upload Button

  <input type="file" id="input" accept="application/pdf" multiple>

Explanation: Input: take input, type: type is file, id: to acess the file, accept: only accept pdf

Now, we get the first file using javascript

  let file = document.querySelector('#input').files[0];

Now, you have a file to use (these can be used for profile pictures or other things)

CodingCactus (4093)

Hi, I've unlisted this as it is fairly low effort and not very in-depth. If you want it to be relisted, then add some more things (examples maybe?) then reply to this comment.