Question

In: Computer Science

HAVE a script to display random images every time you click the browser's refresh button. (Just...

HAVE a script to display random images every time you click the browser's refresh button.

(Just need a script code(s) to add to the default code that will display random images every time you click the browser's refresh button.

DEFAULT CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>Student's Information</title>

</head>

<body>

  <table align ="center" width ="70%">

     <tr>

        <td colspan ="2">

           <h1>&nbsp;</h2>

           <h1>Student's Information</h1>

           <p><input type="button" id="students" value="Enter Data" /></p>

        </td>

     </tr>

  </table>

</body>

</html>

Solutions

Expert Solution

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <!-- Place this img tag where you wants -->
        <img  id="image" style=" width: 300px;height: 300px;" /> 
         <table align ="center" width ="70%">

     <tr>

        <td colspan ="2">

           <h1>&nbsp;</h2>

           <h1>Student's Information</h1>

           <p><input type="button" id="students" value="Enter Data" /></p>

        </td>

     </tr>

  </table>

        
        <script>
            // here you can add images. Just follow same order 
            var img = [
            "img1.png", 
            "img2.png", 
            "img3.png",
            ];
            // random image
            var random = (Math.floor(Math.random() * img.length))
            var image = document.getElementById("image")
            image.src = img[random ]
        </script>
    </body>
</html>

Related Solutions

Have you ever wondered what it means to click the “offset carbon emissions” button when you...
Have you ever wondered what it means to click the “offset carbon emissions” button when you book a flight or train trip? It adds a small cost to your ticket, but how does this reduce emissions? The money is typically used to fund projects that reduce carbon emissions. One such project type is the introduction of more efficient cooking stoves into communities. Much of the world uses inefficient charcoal or wood stoves that result in excessive indoor air pollution, deforestation,...
Have you ever wondered what it means to click the “offset carbon emissions” button when you...
Have you ever wondered what it means to click the “offset carbon emissions” button when you book a flight or train trip? It adds a small cost to your ticket, but how does this reduce emissions? The money is typically used to fund projects that reduce carbon emissions. One such project type is the introduction of more efficient cooking stoves into communities. Much of the world uses inefficient charcoal or wood stoves that result in excessive indoor air pollution, deforestation,...
A slot machine is a gambling device which allows a user to insert money and pull a lever (or push a button) and displays a set of random images.
A slot machine is a gambling device which allows a user to insert money and pull a lever (or push a button) and displays a set of random images. Design a Python program which simulates a "free" slot machine which displays a random combination of 3 of the following items (as text): Cherries, Oranges, Plums, Melons, and Bells If none of the items match, the user wins nothing. If only two of the items match, the user wins $5 If all three items...
Time Value of Money COLLAPSE You have just won the $1,000,000 in the lottery. You have...
Time Value of Money COLLAPSE You have just won the $1,000,000 in the lottery. You have the option of taking a lump sum payout or equal annualized payments over 20 years. Ignoring any tax consequences; how much should you expect from the annualized payments. What target interest rate would make the annualized payments more valuable than the lump sum. In your response, you may want to consider such issues as inflation, investing lump sum in stock market (What have been...
<< Using R code >> Set seed number as "12345" every time you generate random numbers....
<< Using R code >> Set seed number as "12345" every time you generate random numbers. For each answer, use # to explain if necessary. 2) Generate a data.frame "D" with 3 variables. The 1st variable "v1" has 50 number of N(5,3^2) (normal with mean 5, standard deviation 3) The 2nd variable "v2" has 50 number of exp(5) (exponential with parameter 5) The 3rd variable "v3" has 50 random characters from lower case alphabets. 2-1) Rename the variable from "v1",...
Suppose you have a production technology that can be characterized by a learning curve. Every time...
Suppose you have a production technology that can be characterized by a learning curve. Every time you increase production by 1 unit, your costs decrease by $6. The first unit costs you $64 to produce. 1)You estimate you can win another project for two more units. Have your returns diminished? Why or why not? 2)If you receive a request for 4 units, what is your break-even price?
You have created an Inventory account and a Cost of Goods Sold account, but every time...
You have created an Inventory account and a Cost of Goods Sold account, but every time you add a new inventory part item to the Item List, Quickbooks creates an Inventory Asset account and Cost of Goods Sold account. Why does this happen, and how can you correct it?
Suppose you are the IT director at Just-in-Time Airfreight, and you have received authorization to hire...
Suppose you are the IT director at Just-in-Time Airfreight, and you have received authorization to hire another systems analyst. This will be an entry-level position, and the person will assist senior systems analysts on various projects involving the reservations and the human resources systems. Using the information in this chapter, draft an ad that would appear in The Wall Street Journal, local newspapers, and online. You can get some ideas by visiting monster.com, or a similar site. In your ad,...
You have just won a $3,900,000 lottery which pays out $130,000 at the beginning of every...
You have just won a $3,900,000 lottery which pays out $130,000 at the beginning of every year for 30 years. If the required rate of return on lottery winnings is 7.5%, then how much did you win (i.e. at what price are you willing to sell your winnings for)?
<<Using R code>> Set seed nuumber as 12345" every time you generate random numbers. For each...
<<Using R code>> Set seed nuumber as 12345" every time you generate random numbers. For each anser, use # to explain if necessary. 3. Use data "thusen" in ibrary ISwR" 3-1) Remove missing observations in the data, name this set as thu1, and print the first 6 and last 6 observations. 3-2) Rename a variable "short.velocity" -> "x", "blood.glucose" -> "y". 3-3) Draw a scatter plot for "y" by "x", give title "velocity vs.glucose". Put tick marks of x-axis at...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT