Re: inner HTML is it?

by "John" <johnmoz(at)ozemail.com.au>

 Date:  Wed, 30 Jul 2003 11:28:47 +1000
 To:  <hwg-techniques(at)hwg.org>
 References:  apto
  todo: View Thread, Original
alert(document.getElementById("div"+lastDiv).innerHTML);

also just in case anyone wandering through code below:

1. The onClick calls "doI" and it should be "doIt"
2. The alert is duplicated, though it does pop up right first and then is
undefined as is.
----- Original Message -----
From: "John" <johnmoz(at)ozemail.com.au>
To: <hwg-techniques(at)hwg.org>
Sent: Wednesday, July 30, 2003 10:34 AM
Subject: inner HTML is it?


> <.html>
> <.head>
> <.script type="text/javascript">
> var lastDiv = 3;
> function doIt(){
>     alert(???);
> }
> </script>
> </head>
> <.body>
> <.div id="div1" onClick="alert(doI());">Click Me</div>
> <.div id="div2">Yeh Yeh</div>
> <.div id="div3>No No</div>
> </body>
> </html>
>
> If the id of the last div is only known by:
>
> "div" + lastDiv
>
> what do I need to put in the alert arguments [replacing ???] to put into
the
> alert box:
>
> "No No".
>
> Thanks very much in advance.
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA