// in css:
/* Display line under clicked navbar link */
.active {
text-decoration-line: underline !important;
text-decoration-thickness: 2px !important;
color: rgb(20, 19, 19);
}
//in html:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
// Underline to remain in navbar after click using URL
jQuery(function ($) {
var path = window.location.href; // because the 'href' property of the DOM element is the absolute path
$('.nav-link').each(function () {
if (this.href === path) {
$(this).addClass('active');
}
});
});
});
</script>
//Note class in link should be nav-link
Comments
Anonymous - Sun Jun 14 2020 16:01:38 GMT+0000 (UTC)
hi
Anonymous - Sat Jun 27 2020 02:21:50 GMT+0000 (UTC)
Hi
Anonymous - Tue Feb 09 2021 13:01:09 GMT+0000 (UTC)
hlo
Anonymous - Sat Mar 06 2021 18:04:18 GMT+0000 (UTC)
Hi
Anonymous - Sat Mar 06 2021 18:04:22 GMT+0000 (UTC)
Hi
Anonymous - Fri Mar 19 2021 21:33:26 GMT+0000 (UTC)
joe
Anonymous - Mon Mar 22 2021 08:19:40 GMT+0000 (UTC)
hjk
Anonymous - Wed Mar 24 2021 16:14:05 GMT+0000 (UTC)
adsa
www.google.com