Skip to content
Prodjex

Select Data Date Attribute Value with jQuery

1 min read

Select Data Date Attribute Value with jQuery

How can I just select the value of the data-date attribute.

I need to get 2016-02-14 into a jQuery variable.

<td class="fc-day fc-widget-content fc-sun fc-past" data-date="2016-02-14">

You can select it with jQuery using:

$( "td" ).attr( "data-date" )

Demo here

  • data attribute
  • jquery
  • value

Keep reading