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

Java Write a JavaFX application that displays a button and a number. Every time the button...
Java Write a JavaFX application that displays a button and a number. Every time the button is pushed, change the number to a random value between 1 and 100. Thank you and can you show a picture of the result as well
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,...
There is a web advertising company that collects users' data every time they click on a...
There is a web advertising company that collects users' data every time they click on a website, post a message on a social app, send an e-mail, or do any online searching. This data is then sold to companies so that they can use it to send customized advertisements to potential customers. The exercise equipment company you work for is given access to this data, and you are asked to create association rules to identify future customers who are likely...
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...
Revision Question 1 on Linux. Please briefly explain the shell script given. a) You have just...
Revision Question 1 on Linux. Please briefly explain the shell script given. a) You have just logged in and have a directory called "images" in your home directory containing the following files: favicons login.png logo.png newlogo.png where "favicons is a directory and contains the files favicon.ico favicon.gif favicon.png favicon.jpg Describe the results you would expect when executing the following shell commands: i) ls images/*og* | wc -1 ii) ls -ld images/* iii) rmdir images/favicons iv) cp images/*/*png images v) rm...
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?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT