You did not hide the class you just checked it is visible, but if it was not visible you would not be able to click it, try someting like this.
$(function() {
$('.navbar-nav a').on('click', function(){
$(".navbar-toggler").hide();
}
});
Or if you want to use display property.
$(function() {
$('.navbar-nav a').on('click', function(){
$(".navbar-toggler").css("display", "none");
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…