我试图在ajax调用后在2个类之间切换,但出现此错误:
TypeError: toggleButton.children(...)[0].toggleclass is not a function
这是我的代码
console.log(toggleButton.children()['0']);
toggleButton.children()['0'].toggleclass('fa-check fa-times');
这是我试图切换其在控制台中显示方式的元素
<i class="fas fa-times" style="color:red">