0

I want to change the CSS of the dates when they are selected on the basis of their css, specifically class names. But I am unable to get the class name of the td.

Any suggestions how can I get the class name? I tried onSelect and then used .html(), but it returns the whole HTML of datepicker as expected.

Deepanshu Goyal
  • 2,738
  • 3
  • 34
  • 61

2 Answers2

-1

You can get the class name using

$('selector').attr('class');
Praveen
  • 55,303
  • 33
  • 133
  • 164
  • @michaelb958 Thanks for pointing out it. I changed it and found the a good reason from here http://stackoverflow.com/a/16654497/1671639 – Praveen Jul 16 '13 at 12:10
  • well I know this thing, but its datepicker.js, which generates everything dynamically and there is no id to any table or td – Deepanshu Goyal Jul 17 '13 at 11:14
-1

you can get the class name by the following in Jquery

var className = $('#table_id .td').attr('class');