Hi,
I need to replace "Link Text" with the value in the variable (myNewString). myNewString is just text e.g hello

code
document.write(myNewString);

<a href="welcome.html">Link text</a>

i need some thing like the below or even a php version of it

<a href="welcome.html">(myNewString)</a> --this syntax is incorrect it seems

THANKS!!!!!!!!

There are a lot of ways to do something like this, but the way I would do it is a bit of JavaScript saying this:

<a href="welcome.html" id="link">Link text</a>

<script type="text/javascript">
document.getElementById("link").innerHTML = myNewString;
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.