REACT set css style react - Net-Raft.com

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




Just a Web Code Solution
join us

how to set css style using react ?


 212

Show ResultREACT


3

<!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>
</head>
<body>

<script type="text/javascript">

var Hello = React.createClass({
myClick: function () {
document.getElementById("test").style.color = "yellow";
document.getElementById("test").style.backgroundColor = "black";
},
render: function () {
return React.createElement("button", { id: "test", onClick: this.myClick }, "click");
}
});

ReactDOM.render(React.createElement(Hello), document.getElementsByTagName('body')[0]);

</script>

</script>

</body>
</html>


By        
The power of the user (%)
56%

Show ResultREACT


1

<!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>
</head>
<body>

<script type="text/javascript">

var Hello = React.createClass({
render: function () {

return (React.createElement("div", {id:"test", style: {color: "red", backgroundColor: "blue"}}, "Hello world"))

}

});

ReactDOM.render(React.createElement(Hello), document.getElementsByTagName('body')[0]);

</script>

</script>

</body>
</html>


By        
The power of the user (%)
79%



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 ...

  15.3K     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.4K     141

country dropdown using reactcountry dropdown using reactREACT

Click to see more ...

  1.1K     127

create alarm clock using reactcreate alarm clock using reactREACT

Click to see more ...

  3.8K     112

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

Click to see more ...

  863     108

get client country reactget client country reactREACT

Click to see more ...

  602     82

get ip address reactget ip address reactREACT

Click to see more ...

  792     81

time ago reacttime ago reactREACT

Click to see more ...

  439     74

detect mobile device reactdetect mobile device reactREACT

Click to see more ...

  429     58

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