Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/462.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.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或JQuery在HTML中删除表中的特定范围?_Javascript_Jquery_Html - Fatal编程技术网

如何使用JavaScript或JQuery在HTML中删除表中的特定范围?

如何使用JavaScript或JQuery在HTML中删除表中的特定范围?,javascript,jquery,html,Javascript,Jquery,Html,下面是浏览器“元素”选项卡中的代码片段,如何删除选定的范围?请帮助,我只想删除tr下第四个“td”下的跨度,该跨度具有“danger”类 <table id="editable_table" class="table table-bordered table-striped"><thead> </thead><tbody> <tr id="31" class="danger">

下面是浏览器“元素”选项卡中的代码片段,如何删除选定的范围?请帮助,我只想删除tr下第四个“td”下的跨度,该跨度具有“danger”类

<table id="editable_table" class="table table-bordered table-striped"><thead>
          </thead><tbody>
            <tr id="31" class="danger">
            <td>

                 </td>
                 <td class="tabledit-view-mode">

                 </td> 
                 <td class="tabledit-view-mode">

                 <td class="tabledit-view-mode">
                      <span class="tabledit-span" style="display: 
                      inline;">123</span>
                      <input class="tabledit-input form-control input-sm fas 
                         fa-eye-slash" type="password" name="PASSWORD" 
                         value="" style="display: none;" id="password0" 
                         disabled="">
                 </td>
                 <td style="white-space: nowrap; width: 1%;"> 

                </td>                  
          </td></tr></tbody>
</table>
但是有一个错误

Uncaught Error: Syntax error, unrecognized expression: #editable_table > tbody > tr:([class*=danger]) > td[3] > span
at Function.fa.error (jquery.min.js:2)
at fa.tokenize (jquery.min.js:2)
at fa.select (jquery.min.js:2)
at Function.fa [as find] (jquery.min.js:2)
at n.fn.init.find (jquery.min.js:2)
at new n.fn.init (jquery.min.js:2)
at n (jquery.min.js:2)
at Object.onAlways (UserManagement.php:120)
at Object.<anonymous> (jquery.tabledit.min.js:6)
at i (jquery.min.js:2)
Uncaught错误:语法错误,无法识别的表达式:#可编辑_table>tbody>tr:([class*=danger])>td[3]>span
at Function.fa.error(jquery.min.js:2)
在fa.tokenize(jquery.min.js:2)
在fa.select(jquery.min.js:2)
在Function.fa[as find](jquery.min.js:2)
位于n.fn.init.find(jquery.min.js:2)
在新的n.fn.init中(jquery.min.js:2)
at n(jquery.min.js:2)
在Object.onAlways(UserManagement.php:120)
反对。(jquery.tabledit.min.js:6)
at i(jquery.min.js:2)
javascript甚至jquery还有其他方法吗?

如何:

$("#editable_table > tbody > tr[class*='danger'] > td:eq(3) > span").remove();
例如:

setTimeout(函数(){
$(“#可编辑#u table>tbody>tr[class*='danger']>td:eq(3)>span”).remove();
}, 5 * 1000);

123

到目前为止您尝试了什么??添加相关代码,即您的HTML结构、您已经尝试过的代码以及您在尝试该代码时收到的错误消息。没关系。只是不要把选票放在个人身上,继续编辑。您不需要所有的代码……只需要最小的代码来表示问题。但问题必须足够独立,以表明你已经尝试过了,哪些不起作用。一旦你找到了基本的问题需求,你会得到快速的回答谢谢@charlietfl updated!:太感谢你了!
$("#editable_table > tbody > tr[class*='danger'] > td:eq(3) > span").remove();