Search results

Set the Disabled State in React TextBox component

03 Dec 2021 / 1 minute to read

Disable the TextBox by adding the e-disabled to the input parent element and set disabled attribute to the input element.

Copied to clipboard
import * as React from "react";
import * as ReactDOM from "react-dom";
export default class App extends React.Component<{}, {}> {
    public render() {
        return (
                <input className="e-input" type="text" placeholder="Enter Name" disabled={true}/>
                <div className="e-float-input e-disabled">
                    <input type='text' required = {true}  disabled = {true}/>
                    <span className="e-float-line"/>
                    <label className="e-float-text">Enter Name</label>
ReactDOM.render(<App />, document.getElementById('input-container'));