Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to change text color in react

  const [color, setColor] = useState('black');

  return (
	<div style={{textColor: color}}>
  		colored text
  		<button onClick={() => setColor('green')}> change to green </button>
    </div>
   )
Comment

PREVIOUS NEXT
Code Example
Javascript :: .split is not a function 
Javascript :: javaSript string first words to upper case 
Javascript :: how to remove an element javascript html 
Javascript :: how to remove timezone from date in javascript 
Javascript :: how to remove a list of classes from an element using js 
Javascript :: sh: /Users/ahmedqadri/Desktop/Projects/stockNotesAPP-frontend/node_modules/.bin/react-scripts: Permission denied 
Javascript :: how to access parent function from iframe 
Javascript :: dynamic import javascript 
Javascript :: remove duplicates objects from array javascript 
Javascript :: table in text 
Javascript :: javascript calculate time 
Javascript :: epsilon javascript 
Javascript :: how to fill array with consecutive numbers javascript 
Javascript :: sort javascript number array with duplicates 
Javascript :: laravel using react 
Javascript :: delete with body angular 
Javascript :: javascript sort multidimensional array 
Javascript :: transpose of the matrix in javascript 
Javascript :: joi object id validation 
Javascript :: javascript canvas grayscale 
Javascript :: How to loop through an object in JavaScript with a for…in loop 
Javascript :: js date enlever jour 
Javascript :: stop interval js 
Javascript :: how to scroll to an element javascript react 
Javascript :: install latest electron 
Javascript :: flatten an array without using .flat(); 
Javascript :: javascript date convert to unix 
Javascript :: js how to reverse a string 
Javascript :: javascript take last element of array 
Javascript :: get an array with unique values 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =