Question

In: Computer Science

I need to answer the the following questions in Javascript; ------------------------------------------------------------------------------------------------------------------------ 3 Buttons to display “Lion”,...

I need to answer the the following questions in Javascript;

------------------------------------------------------------------------------------------------------------------------

3 Buttons to display “Lion”, “Tiger” and “Leopard” in a line and display textfield on next line

When“Cat” button is clicked the following 3 things will perform

Display text field “User clicks Lion”;

Under the text field display a message “Lion is clicked”;

Under the message, a photo of a lion is displayed. other buttons will work in a similar logic.

------------------------------------------------------------------------------------------------------------------------

Display the pictures of following “Lion”, “Tiger” and “Leopard”.

When users click on the “Lion” pic., alert window displays warning “Please do not click me, click the Leopard”.

When users click on the “Tiger” pic, alert window displays warning “Please do not click me, click the Leopard”

When users click on the “Leopard” pic, the leopard will jump over the Lion and Tiger, meaning that in the beginning it shows Lion Tiger Leopard, when users click the Leopard then it becomes Leopard Lion Tiger, and users click the leopard again then it becomes Lion Tiger Leopard, etc.

-----------------------------------------------------------------------------------------------------------------------

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new web page with name "lionTiger.html" is created, which contains following code.

lionTiger.html :

<!DOCTYPE html>

<html lang="en">

<head>

<!-- title for web page -->

<title>Lion , Tiger , Leopard</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

</head>

<body>

<input type="button" value="Lion" onclick="ClickText('Lion')">

<input type="button" value="Tiger" onclick="ClickText('Tiger')">

<input type="button" value="Leopard" onclick="ClickText('Leopard')">

<br><br>

<!-- textbox to display text -->

<input type="text" id="txtSample"/>

<!-- para to display text -->

<p id="samplePara"></p>

<br><br>

<!-- img -->

<img id="img" width="200" height="200"/>

<!-- <script> is used for javascript -->

<script>

function ClickText(animal)

{

//display text in the textbox

document.getElementById("txtSample").value="User clicks "+animal;

//create element p

document.getElementById("samplePara").innerHTML=animal+" is clicked";//display text

document.getElementById("img").src=animal+".jpg";//display image

}

</script>

</body>

</html>

======================================================

Output : Open web page lionTiger.html in the browser and will get the screen as shown below

Screen 1 :lionTiger.html , screen when lion button is clicked

Screen 2 :lionTiger.html , screen when tiger button is clicked

Screen 3 :lionTiger.html , screen when leopard button is clicked

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

This is in HTML and JavaScript So I have 2 radio buttons One called students and...
This is in HTML and JavaScript So I have 2 radio buttons One called students and one called teacher. If the user selects the student then a list of check boxes these should appear. These should not be visable if the user selects the teacher radio button. - buy text books - visit teachers website - attend class If the user selects the teacher radio button then all the text boxes above should be hidden From the user. Then these...
I need to display the questions that the user answered total, wrong and right as well...
I need to display the questions that the user answered total, wrong and right as well as the average percentage they got correct of the following code please! public class TestCode { public static void main(String[] args) { String choice = "Yes"; Random random = new Random(); Scanner scanner = new Scanner(System.in); while(!choice.equals("No")){ int randomInt = 2 * (random.nextInteger(5) + 1); System.out.println(randomInteger); System.out.print("Want another random number (Yes / No)? "); choice = scanner.next(); } } }
I need an answer to all three questions, please. Q1: Which of the following was not...
I need an answer to all three questions, please. Q1: Which of the following was not a policy response to the Economic crisis associated with the COVID-19 Crisis? Select one: a. The Fed lowered the policy rate by roughly 1.5 percentage points to nearly zero. b. The U.S. Congress passed a roughly $3 Trillion economic stimulus package. c. The Commonwealth of Massachusetts relaxed the balanced budget rule in the State Constitution. d. The Fed introduced facilities to keep markets liquid...
Using javascript, Display the following two statements about Plagiarism and Attendance in 2 paragraphs. Display a...
Using javascript, Display the following two statements about Plagiarism and Attendance in 2 paragraphs. Display a button “Switch paragraphs” between these two paragraphs. Whenever the user clicks the switch button, the 2 paragraphs switch their places. Plagiarism statement: I have read the policy for plagiarism at Wollongong University. I declare that this assignment solution is entirely my work. Button “Switch paragraphs” appears HERE. Attendance statement: I acknowledge that this assignment is scheduled to be marked in the computer lab in...
Part I. Answer the following three (3) questions. Copy and paste the questions into the Text...
Part I. Answer the following three (3) questions. Copy and paste the questions into the Text Submission box (below), then type your answers directly below each question.   Q1. What is feedback? How can verbal feedback affect customer encounters? A. Q2. Give some examples of nonverbal feedback and explain how they complement the verbal message and how they can affect customer interactions. A. Q3. What are the four spatial distances observed in Western cultures, and for which people or situations is...
Part I. Answer the following three (3) questions. Copy and paste the questions into the Text...
Part I. Answer the following three (3) questions. Copy and paste the questions into the Text Submission box (below), then type your answers directly below each question. Q1. What is feedback? How can verbal feedback affect customer encounters? A. Q2. Give some examples of nonverbal feedback and explain how they complement the verbal message and how they can affect customer interactions. A. Q3. What are the four spatial distances observed in Western cultures, and for which people or situations is...
3. With the aid of a diagram, answer the following questions: (i) What is meant by...
3. With the aid of a diagram, answer the following questions: (i) What is meant by the term Efficient Frontier? (Assume no short sales and no riskless lending and borrowing allowed.) (ii) ‘The mean-variance efficiency criterion can identify the optimal investment’. Do you agree this statement? Explain your answer.
PLEASE explain why each answer of the following questions is correct, I need to understand it...
PLEASE explain why each answer of the following questions is correct, I need to understand it . 1)Economy is at its long run equilibrium. Assuming all else equal, stock market collapses and consumer sentiment level deteriorates. Which of the following is incorrect? A. In short run, output level decreases and price level decreases. B. In long run, output level is back to its long run output level. C. In short run, short run aggregate supply decrease. D. In long run,...
***************I NEED THE BEST ANSWER FOR THIS. DON'T WASTE MY QUESTIONS. I NEED MINIMUM 5 PAGE...
***************I NEED THE BEST ANSWER FOR THIS. DON'T WASTE MY QUESTIONS. I NEED MINIMUM 5 PAGE (i will check page count) ANALYSIS FOR THIS. I WILL DOWNVOTE***************** The SWOT analysis is an extremely useful tool for understanding and decision-making for all sorts of situations in business and organizations. SWOT is an acronym for Strengths, Weaknesses, Opportunities, Threats. Information about the  origins and inventors of SWOT analysis is below. The SWOT analysis headings provide a good framework for reviewing strategy, position and...
For each of the 3 causal questions (i, ii, and iii) answer the following (and label...
For each of the 3 causal questions (i, ii, and iii) answer the following (and label your answers clearly): a. What is the outcome variable and what is the treatment? b. Define the counterfactual outcomes Yi(0) and Yi(1) c.What plausible causal channel(s) runs directly from the treatment to the outcome? In what direction would that push the results? d.Is reverse causality a potential concern? e.What are possible sources of selection and/or omitted variable bias in the raw comparison of outcomes...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT