I have an element that has a my custom attribute on a <button class="navbar-toggle">
element called data-toggle-wmc
and I am trying to check whether the attribute value equals a string value called collapse
somehow it has not worked so far.
I tried the following
if ($('button.navbar-toggle').attr('data-toggle-wmc') === 'collapse') {
alert('123yes');
}
I also tried
if ($('button.navbar-toggle').attr('data-toggle-wmc') == 'collapse') {
alert('123yes');
}
I looked at this question but somehow the condition is not being fullfilled.