Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faisal #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pictureGenerator_HW/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//At First I declar the type of action .
let typeOfAction = 'click';
//I let my varable 'button' git the name of the button selector.
let button = document.querySelector('button#randomize');
let imageTage = function(event){
let NE = document.createElement('img');
NE.setAttribute('src', 'https://source.unsplash.com/random');
let targetedDiv = document.querySelector('div.image');
targetedDiv.appendChild(NE);

}
button.addEventListener( typeOfAction, imageTage);
30 changes: 30 additions & 0 deletions pictureGenerator_HW/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

<body>

<div>
<label>
Width:
<input type="number" class="width" />
</label>
<label>
Height:
<input type="number" class="height" />
</label>
<button id="randomize">Get random image!</button>
</div>

<div class="image"></div>

<script src="app.js"></script>
</body>

</html>