"leegold2" wrote[color=blue]
> <html>
> <script>[/color]
For validation, you need the type attribute. The tag should look like:
<script type="text/javascript">
[color=blue]
> <table border=2px><tr><td>[/color]
The border attribute of table elements takes a numerical value without "px"
or other units. Also consider putting all your atribute values in quotes. It
will be required in future HTML versions, and helps avoiding confusing today
already. Like so:
<table border="2">
[color=blue]
> <div id=aa style="display:none"> </a>[/color]
What 's that closing </a> tag about? You 're not posting invalid HTML, are
you? Please run your code through a validator such as <URL:
http://validator.w3.org/ > before taking it to Usenet to avoid
disappointment. And again, try putting quotes around the id value, just like
you did with the style value.
[color=blue]
> <a href=javascript
:toggle(aa)><b>see more</b></a>[/color]
Don't use "javascript
:" as a pseudo-protocol, instead put the script in an
onclick event handler. See this newsgroup's FAQ:
<URL:
http://jibbering.com/faq/#FAQ4_24 >
[color=blue]
> <!-- If I add this table below, it does not work -->
> <table border=2px><tr><td>
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>
> eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee<br>
> <div id=aa style="display:none"> </a>[/color]
What! Another element with "aa" as its id? Remember id's should be unique on
a page. It is what they are all about, it is what they were invented for.
None of the remarks above actually have anything to do with the problem you
describe, except perhaps the double id and the non-quoting of attribute
values. You pass a bald aa to the toggle function, but there is no such
variable. There is an element with "aa" as its id, and that is what you want
to give to the function. Like so:
<a href="#" onclick="toggle(document.getElementById('aa') );return false">
It 's not the most efficient way of coding, but should get you on the way.
--
Ivo