I'm using the below code and it seems to only be half working.
I am trying to make it so when a user clicks on the url the text for the a href tag changes.
For example, a user goes on my site. When they click the url 'Love station' it replaces the text and url to 'Dump Station' if the user then clicks 'Dump station' again it changes it back to 'Love Station'
At the moment it changes the text to dump station, but once i click it again, nothing happens.
Any ideas?
<script type="text/javascript">
function lovestation() {
$.get("../lovestation.php?id=<?echo $sta->ID;?>");
document.getElementById('love').innerHTML="Dump <? echo "$sta->Title";?>"
document.getElementById('love').id="dump"
document.getElementById('love').onclick="dumpstation();"
return false;
}
function dumpstation() {
$.get("../dumpstation.php?id=<?echo $sta->ID;?>");
document.getElementById('dump').innerHTML="Love <? echo "$sta->Title";?>"
document.getElementById('dump').id="dump"
document.getElementById('dump').onclick="dumpstation();"
return false;
}
</script>
id=statements.document.getElementById('dump').id="dump"possibly do?document.getElementById('love').innerHTML="Dump <? echo "$sta->Title";?>"should bedocument.getElementById('love').innerHTML="Dump <? echo '$sta->Title';?>"did you just noticed i have change one double coutation mark to single coutation markid="dump"?