Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

input text react

const {useState} from 'react';

export function Example(){
  const [location, setLocation] = useState("");
  return (
    <div>
<form>
  <label htmlFor="location"> 
    Location: 
    <input 
			type="text" 
			id="location" 
			value={location} 
			placeholder="Location"
			onChange={(e)=>setLocation(e.target.value)}
            />
			
    </label>
  </form>
</div>
)
}
 
PREVIOUS NEXT
Tagged: #input #text #react
ADD COMMENT
Topic
Name
3+4 =