There is a page that shows the economic calendar for Hoy
by default, which appears in the image below.
I've been trying to find a command jQuery
that will return true
or false
depending on whether the called toggleButton Today
is currently selected, but haven't been able to come up with anything.
The code for that link appears here:
<div class="float_lang_base_1 js-tabs-economic">
<a href="javascript:void(0);" id="timeFrame_yesterday" data-identifier="" class="newBtn toggleButton LightGray first">Yesterday</a>
<a href="javascript:void(0);" id="timeFrame_today" data-identifier="" class="newBtn toggleButton LightGray toggled">Today</a>
<a href="javascript:void(0);" id="timeFrame_tomorrow" data-identifier="" class="newBtn toggleButton LightGray">Tomorrow</a>
<a href="javascript:void(0);" id="timeFrame_thisWeek" data-identifier="" class="newBtn toggleButton LightGray">This Week</a>
<a href="javascript:void(0);" id="timeFrame_nextWeek" data-identifier="" class="newBtn toggleButton LightGray">Next Week</a>
<a href="javascript:void(0);" id="datePickerToggleBtn" data-identifier="" class="newBtn toggleButton LightGray datePickerBtn noText datePickerIconWrap"> </a>
</div>
I tried the following method in the Chrome Console
:
$('#timeFrame_today').is(':selected')
And this returned:
false
Which shouldn't be the case because as I mentioned, the button #timeFrame_today
(aka Today
) is selected by default, so I'm at a loss here.
Any ideas?
As I see, they use a class called
toggled
to indicate it, so the most practical thing will be to see if it has it through thehasClass()
jquery methodwhich returns: