按钮以创建已存在的新div

时间:2016-10-06 00:01:25

标签: javascript jquery html css

<form>    
<fieldset>
      <legend>DownTime</legend>
      <div id="downtime">
      Start of DownTime:
      <input type="time" name="startdowntime">
      Reason:
      <select type="text" name="reason">
      <option>Reason1</option>
      <option>Reason2</option>
      <option>Reason3</option>
      <option>Reason4</option>
      </select>
      End of DownTime:
      <input type="time" name="stoptdowntime">
      <br>
      </div>
      </br>
      <button type="button">Add another DownTime</button><br>
      </fieldset>
      <br>
      <fieldset>
</form>

enter image description here

我需要为我创建的按钮添加一个功能吗?使用我要添加的按钮&#39; n&#39;停机时间数量。

1 个答案:

答案 0 :(得分:-2)

$date = date('F d, Y', $ts);

通过Jquery和ES6: -

<form>    
<fieldset>
      <legend>DownTime</legend>
     <div id="parentdiv">
      <div class="downtime">
      Start of DownTime:
      <input type="time" name="startdowntime">
      Reason:
      <select type="text" name="reason">
      <option>Reason1</option>
      <option>Reason2</option>
      <option>Reason3</option>
      <option>Reason4</option>
      </select>
      End of DownTime:
      <input type="time" name="stoptdowntime">
      <br>
      </div>
      </br>
      </div>
      <button type="button" id="addbtn">Add another DownTime</button><br>

      <fieldset>
</form>