32
rated 0 times
[
36]
[
4]
/ answers: 1 / hits: 26650
/ 7 Years ago, thu, september 7, 2017, 12:00:00
I want to add or remove an attribute from an html input element.
What i'm done is this:
constructor(props) {
super(props);
this.state = {inputState: 'readOnly'};
}
And the render function:
<input className=form-control type=text value={floor} {...this.state.inputState} />
As you can see i want set the readOnly attribute on the input element.
But now i get an error which says:
Unknown props
0
,1
,2
,3
,4
,5
,6
,7
on tag. Remove these props from the element
When an user is clicking on the input element it should become editable, so i want to dynamicly change this attribute.
But how can i do that?
More From » reactjs