Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- 다익스트라 이해
- CoreData
- 트레일링 클로저
- Java
- persistentStoreCoordinator
- NSSortDescriptor
- iOS Static Library
- codability
- CoreData Concurrency
- CoreData Stack
- NSPredicates
- leetcode #01
- 2022 부스트캠프
- Swift
- Clean swift
- 1009번
- Swift 고차함수
- Raw value and Associated value
- Swift closure
- iOS Static Library 사용하는방법
- expensive operation
- CoreData Filter
- NSManagedObject SubClass
- Swift LinkedList
- Associated Value
- dateFormatter
- 일급 객체
- 스위프트 클로저
- LightWeight Migration
- Persistent store Coordinator
Archives
- Today
- Total
하루를살자
JS Clone Project [Background] 본문
- Image.js
//Saved Image source names
const images = [
"0.jpeg",
"1.jpeg",
"2.jpeg"
];
//choose random images
const chosenImage = images[Math.floor(Math.random() * images.length)];
//create <img> tag
const bgimage = document.createElement("img");
//add img src
bgimage.src = `img/${chosenImage}`;
console.log(bgimage);
//append img tag on the body
document.body.appendChild(bgimage);
- Key Points
1. createElement()
2. appendChild()
'JS' 카테고리의 다른 글
JS Clone Project [to-do list] - 3, Saving to-do list (0) | 2021.12.09 |
---|---|
JS Clone Project [to-do list] - 1,2 (0) | 2021.12.05 |
JS Clone Project [Quotes] (0) | 2021.12.05 |
JS Clone Project [Clock] - 2, PadStart (0) | 2021.12.05 |
JS Clone Project [Clock] - 1 (0) | 2021.12.04 |
Comments