How to insert hyperlink via jQuery
How can I define a hyperlink as a variable and insert it into the a href using jQuery? The reason for this is that our lead management system is automatically appending all hyperlinks causing some of those with specific URL parameters to break. Here is what I have so far, which I know is a mess:
- <script>
- function linkHigh) {
- var str = "high temps";
- var finalLink= str.link("https://www.weather.com?bref=abcdefg#hightemps");
- document.getElementById("highTemps").innerHTML = finalLink;
- }
- </script>
- <a id="highTemps" href=""onclick="linkHigh()"></a>