RESOLVED - (d)html & javascript: using "this" and elements...
I have this javascript code:
Code:
<script type="text/javascript">
function disp()
{
n = document.getElementById('btwo');
n.style.display=n.style.display=='block'?'none':'block';
}
</script>
And this html:
Code:
<tr id="two">
<td><a href="javascript:void(0)" class="clink" onclick="disp()">Topic: Two</a>
<blockquote id="btwo" class="DisplayNone">Some bumf about this topic</blockquote>
</td>
</tr>
The bit in the blockquote is initially hidden, then when you click the link ("Topic: Two"), it shows the hidden bit (..toggles display style).
I need to un-hardcode the 'btwo' in the script part...
I tried using onclick="disp(this)" , but my knowledge of the DOM tree is pitiful...
Any help / hints appreciated.
Thanks
RESOLVED - (d)html & javascript: using "this" and elements...