Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react focus textarea

const focusDiv = useRef();

useEffect(() => {
 if(focusDiv.current) focusDiv.current.focus(); 
}, [focusDiv]);

return (
  <div ref={focusDiv}></div>
);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to break the foreach loop in javascript 
Javascript :: using .env in cra 
Javascript :: iife javascript 
Javascript :: jquery document ready function 
Javascript :: upload preview image jquery 
Javascript :: tolocalestring format dd-mm-yyyy 
Javascript :: how to make back button react 
Javascript :: javascript check if two arrays contain same values 
Javascript :: toarray javascript 
Javascript :: javascript insert element after 
Javascript :: fill array with values javascript 
Javascript :: stop window.setinterval javascript 
Javascript :: how to remove duplicate object in array javascript 
Javascript :: update object in array if id exists else append javascript 
Javascript :: change select value jquery 
Javascript :: js if dark mode 
Javascript :: javascript tostring method 
Javascript :: how to run javascript in chrome 
Javascript :: javascript check for null variables 
Javascript :: vue get if checkbox is checked 
Javascript :: number to array js 
Javascript :: javascript add data to form 
Javascript :: circular progress for react 
Javascript :: javascript code to calculate compound interest 
Javascript :: javascript backwards loop array 
Javascript :: javascript check if string contains special characters 
Javascript :: usereducer example 
Javascript :: memory leak in javascript 
Javascript :: js array from 
Javascript :: js typeof number 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =