I want to use the same input area as type: text or type: URL at the same time; Is there any way to that
<form onSubmit={this.onFormSubmit}>
<div className='form'>
<input
type='text'
placeholder='Enter search keyword or image URL'
value={this.state.searchTerm}
onChange={(e) => {
this.setState({
searchTerm: e.target.value
})
console.log(e.target.type)
}} />
<button type='submit'>Display</button>
</div>
</form>
The input area is for image search. And I want the user to either use a keyword or image url. I'm using unsplash API for image search