Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

upload file react onclick

<input type="file" id="file" ref="fileUploader" style={{display: "none"}} />
Comment

how to upload file with button react

document.getElementById('buttonid').addEventListener('click', openDialog);

function openDialog() {
  document.getElementById('fileid').click();
}

<input id='fileid' type='file' hidden/>
<input id='buttonid' type='button' value='Upload MB' />
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript equality 
Javascript :: get data from excel using vue js 
Javascript :: angular load on scroll 
Javascript :: javascript for of loop 
Javascript :: map in react 
Javascript :: xmlhttprequest status codes 
Javascript :: The removeChild() Method 
Javascript :: include hover in style jsx 
Javascript :: datatble tab bootstrap 4 
Javascript :: callback in react 
Javascript :: how to append in javascript 
Javascript :: how to make a circle in p5js 
Javascript :: how to get json data in postgresql 
Javascript :: random number in js 
Javascript :: use useRef to get current class 
Javascript :: how to get the text from an input field 
Javascript :: ajax timer 
Javascript :: check if value is array 
Javascript :: url to buffer node.js 
Javascript :: mongoose in nodem js 
Javascript :: an arrow function 
Javascript :: Remove duplicates from arrays using reduce 
Javascript :: use of this keyword in js 
Javascript :: jquery select direct child 
Javascript :: currency format 
Javascript :: javascript remove function from object 
Javascript :: why we use mongoose 
Javascript :: private route in react js 
Javascript :: javascript import module 
Javascript :: how to make javascript function consise 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =