Consider I have a JavaScript variable named link which contains a URL like this: www.google.com. I need to include this variable in href attribute in 2 places, like:
<a href="link">link</a>
This should return something like this: Google
I tried various ways but failed. Is it possible to do like this? The JavaScript variables should be used at both places.
Note:
I need to use the variable inside <a> tag also
I tried various ways but failedCould you at least show us 2 of your tries?