Im trying to modify text and links on a page without reposting to the server. I've been trying to use innertext to change a paragraph element with some success, but the links dont evaluate as html elements. Is there a good way to achieve this?
Example code:
<html>
<head>
<script type="text/javascript">
function changetext()
{
document.getElementById('avar').innerText="More stuff <a href=\"}
</script>
</head>
<body>
<p id="avar">Some stuff <a href="<form>
<input type="button" onclick="changetext()" value="Next">
</form>
</body>
</html>
Example code:
<html>
<head>
<script type="text/javascript">
function changetext()
{
document.getElementById('avar').innerText="More stuff <a href=\"}
</script>
</head>
<body>
<p id="avar">Some stuff <a href="<form>
<input type="button" onclick="changetext()" value="Next">
</form>
</body>
</html>