I have the following code:
if(amStatus === "Logout") {
$('#row-qfauto-1 .large-9').append('<a id="next-password" class="button button-next" href="javascript:;">Next</a>')
$('#next-password').click(function() {
$('#row-html2-0').addClass('next-visible')
$(window).resize()
})
}
$('.button-next').on('click', function() {
$(this).hide()
$(window).resize()
})
As you can see button-next
is being added dynamically with jQuery. So in order to make the button disappear when clicked I decided to use on
.
However, the button doesn't disappear. It just stays there. When I do
$('.button-next').click(function() {
$(this).hide()
$(window).resize()
})
twice in the console, then the button disappears. Weird. What could be the problem?
Live site: http://www.chineselearnonline.com/amember/signup/cloprogressive