Articles → REACT.JS → Set The Attribute Of The HTML Element In React.Js
Set The Attribute Of The HTML Element In React
Specifying The Attribute
import React, { Component } from 'react';
import ReactDOM from 'react-dom'
class Message extends Component {
message = "Hello world";
render() {
return (
<input type="textbox" value={this.message}/>
);
}
}
ReactDOM.render(<Message />, document.getElementById('root'));
Output
Click to Enlarge