4

When I try to select multiple rows using the Ctrl key then the border of the selected td is blue.

I am using this code to check whether the Ctrl key is pressed or not:

$("#unSelectedTab td").click(function (event) {

        if (event.ctrlKey) {
            $(this).toggleClass("backgroundcolor");
        }
        else {
            $("#unSelectedTab td").removeClass("backgroundcolor");
            $(this).addClass("backgroundcolor");
        }
    });
w5m
  • 2,286
  • 3
  • 34
  • 46
Prince Chopra
  • 167
  • 11
  • 1
    I made that code working by adding a css property ` table { -moz-user-select: none; } ` – Prince Chopra May 13 '13 at 07:15
  • use this http://stackoverflow.com/questions/979662/how-to-detect-pressing-enter-on-keyboard-using-jquery change the selector as u need – xicond May 13 '13 at 09:49
  • 1
    @PrinceChopra Could you answer your own question and then later accept it? So that others can find the solution easier. :) – das Keks May 16 '13 at 16:17

1 Answers1

0

Migth be: event.browserEvent.ctrlKey

You should put a breakpoint in Firebug and see what properties event has.

Jonathan
  • 8,771
  • 4
  • 41
  • 78