Forum Moderators: open
I hope somebody can help.
I have several buttons on my webpage and 26 tags for (a-z)
what i want to do is when different buttons are clicked change the ancestor tags in other words some my have links and some may not depending if i have a web page for it.
I'm assuming i need and ID for each Ancestor tag but how to go about doing it?
again I think DHTML will do it but how I can get to the desired element by using this:
document.getElementById('A') ' this is my A link
but i dont know what to do from there, I've been searching on the web for answers but no luck so far?
thanks jason
<script type="text/javascript">
function makeLink(letter) {
if (document.getElementById) {
document.getElementById('theLink').innerHTML = '<a href="' + letter + '.html">' + letter + '<\/a>';
}
}
</script>
<input type="button" id="myButton" onClick="makeLink('F')" value="F">
<input type="button" id="myButton" onClick="makeLink('Q')" value="Q">
<br>
<br>
<span id="theLink"></span>