From: XhmikosR Date: Thu, 1 Dec 2022 18:14:33 +0000 (+0200) Subject: code-examples.js: switch to `firstElementChild` (#37570) X-Git-Tag: v5.3.0-alpha1~37 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=18fec8bf365e34bc8439af99eddc18ec3e14a8a1;p=thirdparty%2Fbootstrap.git code-examples.js: switch to `firstElementChild` (#37570) This ensures that we will get the first element child and not text --- diff --git a/site/assets/js/code-examples.js b/site/assets/js/code-examples.js index 25486c2fe7..edb13598fd 100644 --- a/site/assets/js/code-examples.js +++ b/site/assets/js/code-examples.js @@ -56,7 +56,7 @@ }) clipboard.on('success', event => { - const iconFirstChild = event.trigger.querySelector('.bi').firstChild + const iconFirstChild = event.trigger.querySelector('.bi').firstElementChild const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) const namespace = 'http://www.w3.org/1999/xlink' const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href')