Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to trigger image upload button in from another button react js

upload() {
  document.getElementById("selectImage").click()
}

<div style={{display: 'grid'}}>
  <button id='plus' onClick={this.upload}>+</button>
  <input id='selectImage' hidden type="file" onChange={fileSelectHandler} />
</div>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #trigger #image #upload #button #button #react #js
ADD COMMENT
Topic
Name
4+4 =