【问题标题】:Click a Cell by bootstrap table isn't working通过引导表单击单元格不起作用
【发布时间】:2021-06-10 06:33:48
【问题描述】:

我将编写一个方法,从单击的引导表中给出单元格值。当我首先单击表格标题时,调用了 th 函数。之后,我无法单击单元格。 tdOnClick() 方法仅在我单击之前有效。为什么会这样?

我的 JS:


//if a cell was clicked, this function was called
function tdOnClick(){
    var col = $(this)[0].textContent;
    console.log(col);
}

【问题讨论】:

    标签: javascript html jquery bootstrap-4 html-table


    【解决方案1】:

    您必须在创建表格主体的函数之后添加 tdOnClick() 函数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-17
      • 2014-09-19
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 2018-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多