Skip to content

Commit

Permalink
Merge pull request #36 from hanfamilym1/snippet/buttonClick
Browse files Browse the repository at this point in the history
Button function changed to return array
  • Loading branch information
hanfamilym1 authored Oct 16, 2023
2 parents cb5dbdb + 0791f5e commit e34e07b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions 2023/10/2023-10-16_buttonClickScript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Learning Entry - 2023-10-16

## Type of Learning: Snippet

### What I've Learned:

I got this from stackoverflow [link](https://stackoverflow.com/questions/65271151/how-do-i-fix-my-button-not-working-in-html)

I changed qtwo function to meet my needs:
- return an array

```
function qtwo() {
var text = "";
var numyrs = prompt("How many years do you want to go back in time?");
console.log(numyrs);
switch (numyrs) {
case "2019":
text = "Scientists release first-ever image of black hole."
break;
case "2018":
text = "The United States Leaves the Iran Nuclear Deal."
break;
default:
text = "";
break;
}
// changed
function qtwo() {
return []
}
```

[Write here what you've learned during your study, experiment, or exploration. Be as detailed and informative as possible.]

0 comments on commit e34e07b

Please sign in to comment.