Javascript 我需要隐藏<;tr>;在表格中单击Addnew按钮(WORDPRESS,PHP)
Javascript 我需要隐藏<;tr>;在表格中单击Addnew按钮(WORDPRESS,PHP),javascript,php,html,wordpress,Javascript,Php,Html,Wordpress,(需要隐藏) ----------------------------------------- 单击AddNew按钮时如何隐藏??? 我无法直接给出隐藏或显示:无,因为“编辑并添加新”使用相同的表单。因此,单击添加新,我需要隐藏tablerow 我还尝试过在单击时使用函数(Javascript)“document.getElementById(“appid”).style.display='none';” 我仍然没有得到任何回应。 你们谁能帮帮我吗!!!提前感谢 请参阅此链接,尝试添加以下j
(需要隐藏)
-----------------------------------------
单击AddNew按钮时如何隐藏???我无法直接给出隐藏或显示:无,因为“编辑并添加新”使用相同的表单。因此,单击添加新,我需要隐藏tablerow
我还尝试过在单击时使用函数(Javascript)“document.getElementById(“appid”).style.display='none';”
我仍然没有得到任何回应。
你们谁能帮帮我吗!!!提前感谢
请参阅此链接,尝试添加以下javascript代码
(Need to hide)
-----------------------------------------
<tr class="form-field" id="appid">
<th valign="top" scope="row">
<label for="Application_ID"><?php _e('Application ID', 'custom_table_example')?></label>
</th>
<td>
</tr>
</tbody>
</table>
document.getElementById(“添加新”).addEventListener(“单击”,函数(事件){
document.getElementById(“appid”).style.display='none';
event.preventDefault()
});
兄弟,我用这种方式尝试了页面,但没有重新加载。。。。!!!!!上面的代码@Ravindra Reddy无法正常工作
<div class="icon32 icon32-posts-post" id="icon-edit"><br></div>
<h2><?php _e('Collaboration', 'custom_table_example')?> <a class="add-new-h2" id=" add_new"
href="<?php echo get_admin_url(get_current_blog_id(), 'admin.php?page=persons_form');?>"><?php _e('Add new','custom_table_example')?> </a>
</h2>
(Need to hide)
-----------------------------------------
<tr class="form-field" id="appid">
<th valign="top" scope="row">
<label for="Application_ID"><?php _e('Application ID', 'custom_table_example')?></label>
</th>
<td>
</tr>
</tbody>
</table>
<script type="text/javascript">
document.getElementById("add_new").addEventListener("click", function(event){
document.getElementById("appid").style.display = 'none';
event.preventDefault()
});
</script>