2. Write a JavaScript to create
a. Alert Dialog Box
b. Confirmation Dialog Box
c. Prompt Dialog box
3. Write a JavaScript to Change an image when a user holds down the mouse button.
4. Write a JavaScript to display all the cookies set on your machine.
5. Write a JavaScript to disable right click on the page
3.
CODE
<!DOCTYPE html>
<html>
<head>
<script>
function lighton() {
document.getElementById('myimage').src = "bulbon.gif";
}
function lightoff() {
document.getElementById('myimage').src = "bulboff.gif";
}
</script>
</head>
<body>
<img id="myimage" onmousedown="lighton()" onmouseup="lightoff()" src="bulboff.gif" width="100" height="180" />
<p>Click mouse and hold down!</p>
</body>
</html>
4.
CODE
function get_cookies_array() {
var cookies = { };
if (document.cookie && document.cookie != '') {
var split = document.cookie.split(';');
for (var i = 0; i < split.length; i++) {
var name_value = split[i].split("=");
name_value[0] = name_value[0].replace(/^ /, '');
cookies[decodeURIComponent(name_value[0])] = decodeURIComponent(name_value[1]);
}
}
return cookies;
}
var cookies = get_cookies_array();
for(var name in cookies) {
document.write( name + " : " + cookies[name] + "<br />" );
}
NOTE: As per Chegg policy, I am allowed to answer only 2 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
2. Write a JavaScript to create a. Alert Dialog Box b. Confirmation Dialog Box c. Prompt...
Create an external JavaScript file/code and then write a function that displays an alert box. This box will display when the user clicks the submit button to submit the information typed in the form, so be sure the alert box contains an appropriate message. please use the OnClick event handler for your form's submit button.
Please write in JAVA ONLY Please use a dialog box to prompt the user to enter the radius for a circle (radius should be a double). Then, use a Message Box to display the Radius, Area and Circumference of the circle with that Radius. You will use the Math class constant Math.PI to calculate the Area and Circumference.
Which of these refers to the name:value pairs in JavaScript objects? Select one: a. attributes b. methods c. elements d. variables e. properties Which of these is a popup box that allows the user to click OK or Cancel? Select one: a. prompt box b. choice box c. acknowledgment box d. alert box e. confirm box Which of these is used to register an event handler for clicking the mouse? Select one: a. onmouse b. onMouseClick c. onclick d. click...
***JAVASCRIPT***
I need JAVASCRIPT codes for this question. Also a little
explanation and full screenshots of the codes.
Short 6-1 Upgrade the MPG application In this exercise, you'll upgrade a version of the MPG application so the error messages are displayed in span elements to the right of the text boxes. Estimated time: 10 to 15 minutes. Calculate Miles Per Gallon Miles Driven Mies must be numeric and greater than zero Gallons of Gas Used Gallons must be numeric and...
HTML------------------------------------------------------CSS---------------------------------------------------WEB230 - JavaScript 1 Assignment 7 - FormsSome of these tasks would be better done in HTML or CSS but do them in JavaScript to practice whatwe have learned.1. Select the form element and save it in a variable. From here we can access all of the form fields.2. When the page loads do the following:add the password value "monkey"select the favourite city "New York"clear the textarea3. Add an event handler to the "name" field to change the background color...
MyMenuFrame.java, MyMenuFrameTest.java, a. The title of the frame is “MyNotepad”. b. Create and add border layout. c. Create a text area to display contents. Add the text area to the center of the border layout. d. Create a menu bar. e. Create a file menu. Set mnemonic for file menu. It is “F”. File menu includes three menu items. f. Add a separator between each menu item in the file menu. i. Open 1. Add a short cut for...
JAVASCRIPT Create a simple web page that contains a JavaScript form that will allow the user to answer 7 trivia questions. Your trivia game should contain: 2 text boxes 2 select dropdowns 2 multiple choice questions (using radio buttons, 4 options min) 1 choose-all-that-apply (checkboxes, 4 options min, one answer should be "None of the above"). No part-points for semi-correct answers. The questions can cover any topic you wish - but please keep it professional and easy enough that the...
for Javascript, JQuery
When the page is first opened a user will see the name field and the
three vacation images to the left of the page. The page
should behave according to the following rules.
1. When a user's mouse pointer goes over any image, that image's
border will change to be "outset 10px" and when the mouse pointer
leaves that image it's border will change to "none".
2. When the user clicks a "Vacation" image on the left,...
Homework 8 Re-write this code using a style sheet
not in-line styles
<html> <head><title>position</title>
</head>
<body>
<img src= "snow.jpg" style="positon: absolute; top:0px; left:
0px; z-index: 1">
<img src="nagano_1.jpg" Style = "position: absolute;
top:70px;
left: 150px; z-index:2">
<h1 style= "position: fixed; top:50px; left: 50px;
color:2338ee; z-index:3";>
this is a test of position</h1>
</body></html>
1. Create an HTML file that uses an alert dialog box to display the message "Hi There!" when the page loads 2. Create an HTML file that creates...
Need help on following Java GUI problem: Write a program that lets a user display and modify pictures. Create a window. Add four buttons so that clicking a particular button will shift the image by a small amount in the north, south, east or west direction inside the window. Add a menu bar with two menus: File and Image. The File menu should contain an Open menu item that the user can select to display JPEG and PNG files from...