javascript - 拉维尔 | Javascript |在 Blade 中选择特定的 html 表

标签 javascript jquery laravel

我有 javascript 代码,可以选择 Laravel Blade 中现有的所有表中的数据。

我只想将此代码应用于 id="exemple" 的特定表。我怎样才能做到这一点?

我的 JavaScript 代码:

<script>
  function groupDataByDate() {
    var columns, columnOrder, data,
    table = $('table'), mainObj = {};
    columns = [{
      title: 'date',
      values: [4,9]
    }];

    table.find('tbody tr').each(function() {
  }

最佳答案

而不是使用

table = $('table');

其目标是所有 <table> HTML 中的元素,使用

table = $("#example");

仅以 id="example" 为目标元素.

关于javascript - 拉维尔 | Javascript |在 Blade 中选择特定的 html 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53421024/

相关文章:

jquery - 在 IE9 中访问 navigator.userAgent 时权限被拒绝

php - Laravel 查询生成器 - 高级连接和选择

php - 使用带有 AJAX 请求的 CodeIgniter 保护 api

javascript - Google Javascript v8 - 多线程

javascript - Summernote:启用空中模式以及默认工具栏

javascript - 删除重复的特定 td 文本

javascript - 以 getbounds 和相关问题为中心的 Leaflet map

javascript - 如何获取随机 json 数据并附加到 div 元素

php - 如何在 laravel 上编辑列?

php - 如何从数组 ex : posts that belong to filter 3 and 5 中查询属于过滤器的帖子