From 390fc02438ce16c45b162a4dcd1d9c5df89eb6b2 Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Tue, 25 Jun 2024 13:48:38 +0100 Subject: [PATCH] Get the href attribute of the clicked link Signed-off-by: Huong Nguyen --- .../theme/kedro-sphinx-theme/layout.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html b/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html index 3e41ade..90a85df 100644 --- a/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html +++ b/src/kedro_sphinx_theme/theme/kedro-sphinx-theme/layout.html @@ -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; }); }); });