REACT change font color react - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

change font color react


 249

Show ResultREACT


2

<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.3.min.js "></script>
<script src="https://fb.me/react-dom-0.14.3.min.js "></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
</head>
<body>

<script type="text/babel">

class App extends React.Component {
constructor() {
super();

this.state = {
data: []
}

this.findDomNodeHandler = this.findDomNodeHandler.bind(this);
}

findDomNodeHandler() {
var myDiv = document.getElementById('myDiv');
ReactDOM.findDOMNode(myDiv).style.color = 'red';
}

render() {
return (
<div>
<button onClick = {this.findDomNodeHandler}>Click</button>
<div id = "myDiv">Hello world!</div>
</div>
);
}
}

ReactDOM.render(
<App/>,
document.getElementById('my-div')
);

</script>

<div id="my-div"></div>

</body>
</html>


By        
The power of the user (%)
52%



The most helpful REACT solutions

How to get client ip address using react ?How to get client ip address using react ?REACT

Click to see more ...

  14.6K     421

how to get the type of a device using react ?how to get the type of a device using react ?REACT

Click to see more ...

  1.9K     214

create digital clock reactcreate digital clock reactREACT

Click to see more ...

  1.3K     141

country dropdown using reactcountry dropdown using reactREACT

Click to see more ...

  1K     127

create alarm clock using reactcreate alarm clock using reactREACT

Click to see more ...

  3.7K     112

How to get latitude and longitude using react/javascript ?How to get latitude and longitude using react/javascript ?REACT

Click to see more ...

  843     108

get client country reactget client country reactREACT

Click to see more ...

  586     82

get ip address reactget ip address reactREACT

Click to see more ...

  770     81

time ago reacttime ago reactREACT

Click to see more ...

  426     74

detect mobile device reactdetect mobile device reactREACT

Click to see more ...

  413     58