How to manipulate a TD using Jquery

0

I have a value in a TD and I need to recover it, it's a calendar and every date I click on the calentario there is a different class on each date, I need it, when I click on that date, I can recover the month and year of the day I clicked, I have the following return executing this code.

In short, I need to retrieve this date appearing on the console.

var dateSelectClick = $(target); console.log(dateSelectClick);

follows a print with the console's return.

    
asked by anonymous 22.03.2016 / 20:33

1 answer

0

Try to traverse the object

var objData = $(target);
var dateSelect = "";

$('elemento').click(function(){

 $.each(objData,function(i,e){
    dateSelect = e.data._i; //copia o valor da data para variavel dateSelect
  });

});
    
22.03.2016 / 21:05