rn4 js8
rn4 js8
rn4 js8
part II
<!DOCTYPE html>
<html>
<head>
<title>Experiment 8</title>
<style>
body
background-image: url('slider-left-dec.png');
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
margin: 0;
padding: 0;
.container
display: grid;
grid-gap: 20px;
.eventOutput
background-color: #f4f4f4;
padding: 20px;
margin: 20px;
border-radius: 5px;
label
{
display: block;
font-weight: bold;
margin-bottom: 5px;
#submit, #reset
width: 20%;
padding: 6px;
margin: 8px;
background-color: black;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
#colorBox
widh: 600px;
height: 180px;
background-color: black;
</style>
</head>
<body onload="onLoad()">
<div class="container">
<div class="eventOutput">
</div>
<div class="eventOutput">
<p id="keyOutput"></p>
</div>
<div class="eventOutput">
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
<option value="Black">Black</option>
</select>
<p id="demo"></p>
</div>
<div class="eventOutput">
</div>
<div class="eventOutput">
<label for="name">Name:</label>
<label for="email">Email:</label>
</form>
</div>
</div>
<center>
<div class="eventOutput">
<div id="colorBox"></div>
</div>
</center>
<script type="text/javascript">
function onLoad()
colorBox.style.backgroundColor = '#676767';
function onUnLoad(event)
const confirmationMessage = "You have unsaved changes. Are you sure you want to leave
this page?";
(event || window.event).returnValue = confirmationMessage;
return confirmationMessage;
window.onbeforeunload = onUnLoad;
function onKeyPress()
function onKeyUp(event)
function onKeyDown(event)
function onChange()
let x = document.getElementById("mySelect").value;
function onSelect()
selectedTextSpan.textContent = selectedText;
function onFocus()
document.getElementById("myInput").style.background = "#BEBEBE";
function onBlur()
document.getElementById("myInput").style.background = "#676767";
function onSubmit()
return false;
return false;
function onReset()
</script>
</body>
</html>