0

i need help i can't click the same element with 2 different classes

 $(document).ready(function(){
        $(".hello,.ciao").on("click",function (){
        $(nera).clone().removeClass("hello").addClass("ciao").appendTo($('#dama tr 
         #'+sinistra));
        $(nera).remove();

'

  • Assuming that you're trying to detect the click on an element that has two classes, you may want to look at: http://stackoverflow.com/questions/1041344/how-can-i-select-an-element-with-multiple-classes – Optimae Apr 13 '17 at 10:13

2 Answers2

0

The issue seems to be with this line

$(".hello,ciao").on("click", function() {

There is no selector before ciao

I presume it will be like this

$(".hello,.ciao").on("click", function() {
brk
  • 48,835
  • 10
  • 56
  • 78
  • i put the selector but nothing happens,i click the element with class "hello" and works to appendTo() , i need to click again to this element to do something more – Robert Miron Apr 13 '17 at 10:56
0

Try this

$(document).ready(function(){
        $('.hello.ciao').on("click",function (){
        $(nera).clone().removeClass("hello").addClass("ciao").appendTo($('#dama tr 
         #'+sinistra));
        $(nera).remove();
Saurabh Verma
  • 1,534
  • 1
  • 14
  • 28