表单元素和相关标签

时间:2018-06-23 16:57:28

标签: javascript html labeling

如何在下面的代码中为表单元素创建关联标签?

[debug] [phantom] opening url: http://localhost/client/charg/go/xxx, HTTP GET

1 个答案:

答案 0 :(得分:0)

在下面使用。

<section className="col">
    <div className="input-group">
      <label for="search-input">Filter</label>
      <input type="text" 
      id="search-input" 
      ref="searchInput" 
      className="form-control" 
      placeholder="Filter location..." 
      onChange={this.handleChange} />
    </div>
  </section>

创建标签并将输入元素ID赋予标签的属性