Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在html页面中动态添加div字段?_Javascript_Jquery_Html_Css_Jquery Append - Fatal编程技术网

Javascript 如何在html页面中动态添加div字段?

Javascript 如何在html页面中动态添加div字段?,javascript,jquery,html,css,jquery-append,Javascript,Jquery,Html,Css,Jquery Append,我试图在单击按钮时动态添加一个div字段,但没有得到响应。这是我的密码 试试这个 <div id="para"> <tr class="divider"></tr> <tr> <td><input type="text" placeholder="Enter Medicin Name" style="width:80%;height:30px;"></td> <td><

我试图在单击按钮时动态添加一个div字段,但没有得到响应。这是我的密码


试试这个

<div id="para">
  <tr class="divider"></tr>
  <tr>
    <td><input type="text" placeholder="Enter Medicin Name" style="width:80%;height:30px;"></td>
    <td><input type="file" </td>
    <td><input type="time" placeholder="Enter Medicin Time"></td>
    <td><input type="date" placeholder="Enter Start Date"></td>
    <td><input type="date" placeholder="Enter End Date"></td>
  </tr>
  <tr class="divider"></tr>
</div>
<button type="submit" class="button" id="btn1" value="Submit"><img src="images/plus.png"> Add More Notification</button>


您的控制台是否显示任何eror?不,没有错误您的html无效。您不能在
div
中使用
tr
。也许问题就在这里。Mohammad仍然无法工作您将
div
更改为
table
,但没有用词?如果您发现答案正确,请勾选它作为您的答案。。谢谢@AmitChauhan
<div id="para">
  <tr class="divider"></tr>
  <tr>
    <td><input type="text" placeholder="Enter Medicin Name" style="width:80%;height:30px;"></td>
    <td><input type="file" </td>
    <td><input type="time" placeholder="Enter Medicin Time"></td>
    <td><input type="date" placeholder="Enter Start Date"></td>
    <td><input type="date" placeholder="Enter End Date"></td>
  </tr>
  <tr class="divider"></tr>
</div>
<button type="submit" class="button" id="btn1" value="Submit"><img src="images/plus.png"> Add More Notification</button>