I am working on some code where my objective is to create ten divs on the page. The divs will all contain the same class name, no IDs, and be styled. The goal is that on click that the div that is clicked change its style. I am using the 'This' function to achieve that however I cannot get my divs to change after I uploaded the file. On mousedown on any of the divs, only the particular div that is clicked is to change to 200x400 and red. The HTML text in the div is also supposed to change upon being clicked. Then on the mouseup anywhere on the body of the page all the divs should change back to green. Beneath is my code, I did have it working and now it seems I have messed up somewhere along the way. Any help would be appreciated. I had previously posted but have since deleted that post since I had made some changes to the code. Since those changes I have had the problem of the styles not changing.
<!DOCTYPE html>
<html>
<head>
<title>Page 1</title>
</head>
<style type="text/css">
.div1 {
background-color: green;
height: 100px;
width: 200px;
color: red;
text-align: left;
}
</style>
<script type="text/javascript" src="jquery-3.4.1.min.js"></script>
<script type="text/javascript">
$(".div1").mousedown(function(evt) {
$(this).css({
"height": "200px",
"width": "400px",
"background-color": "red",
"color": "green",
"text-align": "right",
}).html("Lynch");
});
$(".div1").mouseup(function(evt) {
$(this).css({
"height": "100px",
"width": "200px",
"background-color": "green",
"color": "red",
"text-align": "left",
}).html("Chris");
});
</script>
<body>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
<div class="div1">
<h3>
Chris
</h3>
</div>
</body>
</html>