Sinple ?

13 views
Skip to first unread message

Rory

unread,
Jan 14, 2014, 2:49:22 AM1/14/14
to asci...@googlegroups.com

Hello Colleagues

 

I wonder if any of you can help me.

 

The following code inserts the fraction two thirds in the document initially but subsequent button presses give `2/3`.  I  want the fraction not the output if asciimaths was not there.

What am I missing ?

Here is the code. Please help.

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

  <head>

    <meta content="text/html; charset=windows-1252" http-equiv="content-type">

    <title>Toby</title>

    <script type="text/javascript" src="../../../ASCIIMathML.js"></script>

     <script type="text/javascript" >

       var x = 0;

function increase()

{

  x++;

  if (x%2 == 0)

      {

      document.getElementById("p1").innerHTML="`2/3`";

      }

  if (x%2 == 1)

      {

      document.getElementById("p1").innerHTML="spooky";

      }  

    

   }

       </script>

  </head>

  <body>

    <p id="p1">Hello World!</p>

    <script type="text/javascript" >

     

      if (x%2 == 0)

      {

      document.getElementById("p1").innerHTML="`2/3`";

      }

      //document.getElementById("p1").innerHTML="Anus";

      </script>

    <p>The paragraph above was changed by a script.</p>

   

    <div align="center"><br>

       

        <input name="button" onclick="increase()" value="Try again" type="button">

      </div>

   

</p>

  </body>

</html>

 

          type="button">

      </div>

   

</p>

  </body>

</html>


Rory Barrett

Reply all
Reply to author
Forward
0 new messages