I want to use jquery in react. I have an input field in my project.I'm making a match event with 'this.state.value' in my input field. In this control, my input borders have green borders if they match, and red borders if they don't. I want the border to stay with permanent color if there is no match. How can i do it ?
<input className={this.state.value1 != this.state.value1.match(/^[a-zA-ZĞÜŞİÖÇğüşiöç]+$/) ? "redBorder inputInfo" : "greenBorder inputInfo"} name="value1" type="text" placeholder="Name" value1={this.state.value1} onChange={this.handleChange} />
This is css :
input[type=text].redBorder:focus{
border: 3px solid red;
}