Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.computer > #10659

Re: javascript help, please

From Paul <nospam@needed.invalid>
Newsgroups alt.computer
Subject Re: javascript help, please
Date 2018-01-12 03:00 -0500
Organization A noiseless patient Spider
Message-ID <p39pv3$lc0$1@dont-email.me> (permalink)
References (4 earlier) <zji5C.226670$qV5.119545@fx37.iad> <p34jph$mq3$1@dont-email.me> <5fw5C.320086$iX.50068@fx39.iad> <p36mj8$nft$1@dont-email.me> <8WY5C.336718$gy4.129899@fx35.iad>

Show all headers | View raw


Robert Baer wrote:

<programming problem>

Quickest change I could do, was to move
your script section inside the div. Hope
this pushed you along a tiny bit further.

****************************************************
<!DOCTYPE HTML>
<html lang="en">

<head>
     <title>Test of document.getElementById(id)</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
     <!-- Copied from https://www.w3schools.com/js/js_output.asp "Using innerHTML" -->
     <h1>My First Web Page</h1>
     <p>My First Paragraph</p>

     <p id="demo"></p>

     <script>
         document.getElementById("demo").innerHTML = 5 + 6;
     </script>

     <br> Above works, so go for the gold. <br>

     <p id="first">Some text here. This works</p>
     <div style="position: absolute; top: 30px; left: 550px; ">
         <p> For Codatron&reg; PCB programming. </p>
         <H1 id="dv">Have it here</H1>
         <script>
             var fullUNPOP = 1290; // Full, unpopulated board voltage
             var unitVoltage = fullUNPOP / 78;
             var desiredVoltage = 1250; // ** TEST FOR ALL JUMPERS REMOVED
             // attempt to get value to user
             document.write("Unit voltage is:" + unitVoltage + "<br>"); //at top left
             document.write("Desired voltage is:" + desiredVoltage + "<br>"); //near top left
             document.getElementById('dv').innerHTML = fullUNPOP; // "Have it here" gets replaced with voltage
           //document.getElementById('ev').innerHTML = unitVoltage;
         </script>
     </div>
     <script>
         var fullUNPOP = 1290; // Full, unpopulated board voltage
         var unitVoltage = fullUNPOP / 78;
         var desiredVoltage = 1250; // ** TEST FOR ALL JUMPERS REMOVED
         // attempt to get value to user
         document.write("Unit voltage is:" + unitVoltage + "<br>"); //at top left
         document.write("Desired voltage is:" + desiredVoltage + "<br>"); //near top left
         document.getElementById('dv').innerHTML = fullUNPOP; // "Have it here" gets replaced with voltage
         document.getElementById('ev').innerHTML = unitVoltage; // "Reference: Paul" DOES NOT get replaced
     </script>
     <p id="ev">Reference: Paul</p>
     NOTE: above did NOT work

</body>

</html>
****************************************************

    Paul

Back to alt.computer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-02 04:26 -0500
  Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-02 13:56 -0800
  Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-02 18:18 -0500
    Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-07 16:24 -0800
    Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-09 22:23 -0800
      Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-10 03:44 -0500
        Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-10 22:44 -0500
          Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 02:49 -0500
            Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:10 -0800
          Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 03:00 -0500
            Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:16 -0800
          Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 04:29 -0500
            Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:39 -0800

csiph-web