Skip to content

Commit

Permalink
Get the href attribute of the clicked link
Browse files Browse the repository at this point in the history
Signed-off-by: Huong Nguyen <huongg1409@gmail>
  • Loading branch information
Huong Nguyen committed Jun 25, 2024
1 parent fe41c77 commit 390fc02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@

// Add 'active' class to the clicked link
event.target.classList.add('active');


// Get the href attribute of the clicked link
var href = event.target.getAttribute('href');
console.log(href); // This will log the href to the console

window.location.href = href;
});
});
});
Expand Down

0 comments on commit 390fc02

Please sign in to comment.