Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/407.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替换表中的字符_Javascript_Jquery_Html - Fatal编程技术网

Javascript jQuery替换表中的字符

Javascript jQuery替换表中的字符,javascript,jquery,html,Javascript,Jquery,Html,这是我的桌子 <table> <tr> <td>"James"</td> <td>"do"</td> <td>"you</td> <td>"like</td> <td>"your life"</td> </tr> </table> <button>Let the ma

这是我的桌子

<table>
  <tr>
    <td>"James"</td>
    <td>"do"</td>
    <td>"you</td>
    <td>"like</td>
    <td>"your life"</td>
  </tr>
</table>


<button>Let the magic begin</button>

你必须在你的正则表达式中以报价为目标

$(“按钮”)。在(“单击”)上,函数(e){
$('table tr td').text(函数(x,txt){
返回txt.replace(/\“/g,”);
});
});

“詹姆斯”
“做”
“你
“就像
“你的生活”

让魔术开始吧
你必须在你的正则表达式中以报价为目标

$(“按钮”)。在(“单击”)上,函数(e){
$('table tr td').text(函数(x,txt){
返回txt.replace(/\“/g,”);
});
});

“詹姆斯”
“做”
“你
“就像
“你的生活”
让魔术开始吧
$("button").on( "click", function(e) {
  $('table').find("tr").each(function() {
      $(this).replace(/\+/g, '');

    });
});