I'm trying to implement jQuery in React. I have an input field in my project that I am using to create a match event with 'this.state.value'. When the content of the input field matches, I want the borders to turn green and red if they do not match. However, I would like the border color to remain permanent even if there is no match. How can I achieve this?
<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} />
Here is the CSS for it:
input[type=text].redBorder:focus{
border: 3px solid red;
}