erinsydd Posted August 30, 2022 Share Posted August 30, 2022 Site URL: https://www.swoopanalytics.com/ I am trying to change all ® symbols across my site to superscript. There are too many to manually change all of the text blocks to code/markdown blocks so I'm looking for a javascript or CSS solution. Any suggestions would be very much appreciated! Link to comment
tuanphan Posted August 30, 2022 Share Posted August 30, 2022 The only way is use script code. I remember you used to add a script code then remove it. Can you send it? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
erinsydd Posted September 1, 2022 Author Share Posted September 1, 2022 Yes, it was causing some images on the pages to disappear... Here's the code: <script> /* superscripting all ® which aren't already */ window.addEventListener("DOMContentLoaded", function(){ document.querySelectorAll("p, a, h1, h2, h3, h4, h5, h6, label").forEach(function (el) { el.innerHTML = el.innerHTML.replace(/®(?!\<\/sup)/g, "<sup>®</sup>"); }) }); </script> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment