我在react中创建了一个表单,当前当单击该字段时,它会添加一个蓝色边框(我想保留它),但我希望在下面显示一些额外的文本,但我不确定该怎么做?
基本上,我有一个名字的字段,当它被点击时,我想“输入你的名字”出现在这个字段下面。
这是我目前所拥有的:
<div className="form-group form-row">
<label
id="firstNameLabel"
className="col-md-2 col-form-label text-md-right"
htmlFor="firstName1"
readOnly
>
First Name*
</label>
<div className="col-md-10">
<input
type="text"
className="form-control"
name="firstName1"
ref="firstName1"
placeholder="First Name"
value={this.state.firstName1}
onChange={this.handleChange}
required
/>
<div className="error" id="firstnameError" />
</div>
</div>
https://stackoverflow.com/questions/56384303
复制相似问题