element stops firing jQuery after 2nd click -
element stops firing jQuery after 2nd click -
i have anchor tag want utilize toggle class name on parent element.
the code works fine 2 clicks of anchor click doesn't register jquery anymore.
html
<div class="toolbar"><form method="post" action="..." id="facsearch" name="facsearch" onsubmit="facsearch(document.facsearch); homecoming false;"> <a href="..." class="advanced-toggle">advanced</a></form></div>
javascript
$('#facsearch').on('click', '.advanced-toggle', function(e) { console.log($(this)); e.preventdefault(); $('.toolbar').toggleclass('is-advanced'); var mylink; if($(this).text() == 'advanced') { var mylink = $(this).text('close advanced'); } else { var mylink = $(this).text('advanced'); } homecoming false; });
jquery
Comments
Post a Comment