Actually I need a bit of Java Script, but I am definitely not good at it. So I would really need your help.
My problem is, that I would need a script, which saves me the url from an id to a variable and outputs the variable something like this: <a href="+ variable +">LINK</a>
.
Note, that the ID, where I would like to get the link from, is somewhere in the page and the script likely at the bottom.
EXAMPLE OF WHAT I MEAN:
<div id="http://www.example.com" name="url">
<p>Some content</p>
</div>
.
.
.
.
<a href="+ variable +">LINK</a>
.
.
.
<script>
variable = getIdWhereNameIsURL;
....
</script>
Would really appreciate your help!
First of all,
id="http://www.example.com"
may seems odd, but it should be OK per the HTML 5 specs. It is also unusual to have a NAME attribute for a DIV element.Second, it will be easier to specify another id for your LINK, perhaps something like
<a id="link_id">LINK</a>
.Then, you can have the below in your script block