create a web page with a textbox labelled "color", and several; h1's. when the user clicks on any h1 change the color of the h1 that was clicked to color that is typed in the textbox using javascript.. please help me out
Code
<!DOCTYPE html>
<html>
<head>
<title>Color Label</title>
</head>
<body>
Label : <input type="text" id="Label"> <!-- Text
Label-->
<div id="1"><h1>First Heading</h1></div>
<!-- Headings -->
<div id="2"><h1 >Second
Heading</h1></div>
<div id="3"><h1>Third Heading</h1></div>
<!-- We assign ids to each element -->
<div id="4"><h1>Fourth
Heading</h1></div>
<div id="5"><h1>Fith Heading</h1></div>
</body>
<script type="text/javascript">
document.getElementById('1').onclick =
changeColor1; // adding on click event to each elmenet and calling
respective functions
document.getElementById('2').onclick = changeColor2;
document.getElementById('3').onclick = changeColor3;
document.getElementById('4').onclick = changeColor4;
document.getElementById('5').onclick = changeColor5;
function changeColor1() {
document.getElementById('1').style.color =
document.getElementById("Label").value; // change color for id 1to
what is entered in text box
return false;
}
function changeColor2() {
document.getElementById('2').style.color =
document.getElementById("Label").value; // similarly change value
for other h1's
return false;
}
function changeColor3() {
document.getElementById('3').style.color =
document.getElementById("Label").value;
return false;
}
function changeColor4() {
document.getElementById('4').style.color =
document.getElementById("Label").value;
return false;
}
function changeColor5() {
document.getElementById('5').style.color =
document.getElementById("Label").value;
return false;
}
</script>
</html>
Output
create a web page with a textbox labelled "color", and several; h1's. when the user clicks...
Create a webpage in which the user is allowed to select the page's background and color whether the page uses serif or sans serif fonts. The change the body element's style attribute accordingly. If the user onclicks any of the options, the webpage will turn into that format. For example, if the user clicks "Gray background", the background color of the webpage will be Gray. If the user clicks Serif-text, the text in the web page will be in Serif...
HTML Web Page project: Need help to create a web page exactly as the example below using HTML. I need the source code. Page 1 of CA272 Midterm Welcome to your name's CA272 Midterm Text In this class, I learned how to... 1. create an X)HTML web page, where I can 2. change the size of my font, 3. change the color of my fonts, 4. change my font style, 5. and change the background color of my web page....
Create a web page like the one shown here. The user can enter a number n, and when the button is clicked, the Harshad numbers between 1 and n are displayed: linking an html file with a javascript file. Count 'em! Find and Count the Niven Numbers Between 1 and: 200 Number of Nivens: 59 Niven Numbers: 1 23456789 10 12 18 20 21 24 27 30 36 40 42 45 48 50 54 60 63 70 72 80 81...
Please help me~~~~ using javascript, Display a text field so that the user can enter an integer. Display two buttons “Start Animation” and “Stop Animation”. When the button “Start Animation” is clicked, the web page displays an animated times table in the following manner. For example, if the user entered the number 6, then the animation displays 6 x 1 = 6, one second later it replaces it with 6 x 2 = 12, one second later it replaces it...
Using JavaFX create a Roll application that implements the GUI shown When the user clicks the Roll button, the program must roll the dice, change the figures randomly, calculate the sum of the dice and show it in a label
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,...
Please help with this assignment section A. This question is from world wide web Info Sys Dev. Section A te HTML/JavaScript web page called sectiona.html, that has the fpllowing items: a. 2 text items labeled as "CAD Dollar" and "US Dollar", the first(CAD dollars) is enabled with id-"cad", while the later is disabled with id-us" b.1 button named as "convert". functionality: When the user clicks on the button, a JavaScript function named "convert" will be called to convert the value...
Using PHP and MySQL, create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions. Include links on the main page that allow you to create a new bug report and update an existing bug report. I have tried the various solutions provided previously for this exercise, but it does not work because every author...
i need help with this homework web page and i need the code too Using the "do while" or the "for" control statements, have a visitor to your Web page do, or see, something repeatedly. You could have him or her enter a number of months, an interest-rate, and an amount, and print out a table with the amount on deposit. Try to make the loop appropriate to the website theme that you have picked. Use a function in your...
HTML Create a webpage with three divisions. Division 1 occupies the left-side of the page with a few links of your choice. Division 2 and 3 have the same width. You may use % to specify the width. For example, for division 1: width:20%, and for division 2 and 3: width:80%. Division 2 is used to display an image of your choice using the background-image property. Division 3 is to show the double-declining depreciation table, and has a background color...