小编Rav*_*uri的帖子

如何使用 js/css 禁用特定类的 </td> 选择?

我的日历是用 html 表构建的,其中很少有日期可以选择。所以我需要禁用所有其他数据。

突出显示 td 的功能:

/* Get all rows from your 'table' but not the first one 
        * that includes headers. */
var rows = $('td').not(':first');

/* Create 'click' event handler for rows */
rows.on('click', function (e) {

  /* Get current row */
  var row = $(this);

  /* Check if 'Ctrl', 'cmd' or 'Shift' keyboard key was pressed
            * 'Ctrl' => is represented by 'e.ctrlKey' or 'e.metaKey'
            * 'Shift' => is represented by 'e.shiftKey' */

  if ((e.ctrlKey || e.metaKey) …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery razor

2
推荐指数
1
解决办法
3万
查看次数

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1

razor ×1