js 랜덤 활용
const phrase = [ { one:"It is", two:" test" } , { one:"It's", two:" TEST" } ] const image=[ "0.jpg", "1.jpg", "2.jpg" ] const put = document.querySelector(".ph span:first-child"); const put1 = document.querySelector(".ph span:last-child"); const num = phrase[Math.floor(Math.random()*phrase.length)]; put.innerText = num.one put1.innerText = num.two const num1=image[Math.floor(Math.random()*3)] co..
웹/js
2022. 6. 28. 18:10