SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Javascript with Java Applets

    What i am intending on doing is having two buttons and java applet. I want to have it so when you click a button it changes to another applet, and then when you click the other button, it goes to the original appet. how would i do this?

    this is my code and so far it doesnt work
    PHP Code:
    <div align="center">
      <
    input name="Button" type="button" onclick="document.getElementByID('applet1').style.display='none';document.getElementByID('applet2').style.display='block';" value="Hell of Sand" />
      <
    input name="button2" type="button" onclick="document.getElementByID('applet1').style.display='block';document.getElementByID('applet2').style.display='none';" value="Pyro Sand" />
    <
    div id="applet1">
        <
    applet code="Falling_Sand_Game" width=520 height=460 archive="fsg_small.mp3"></applet>
    </
    div>
    <
    div id="applet2">
    <
    applet code="HellOfSand" style="display:none" width=520 height=460 archive="HellOfSand.jar"></applet>
    </
    div
    go to http://pageofrage.t35.com/sandgames.php to see what happens with this code

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    getElementById

    cheers

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx
    Last edited by Alphamonkey; Sep 30, 2006 at 06:58.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •