Skip to content

Commit

Permalink
using querySelector to hide frames and imp tags when not in use
Browse files Browse the repository at this point in the history
  • Loading branch information
ShdwSpde committed Sep 28, 2022
1 parent 79be965 commit ec35cbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ function getFetch(){
console.log(data)
if (data.media_type === 'image'){
document.querySelector('img').src = data.hdurl
document.querySelector('iframe').style.display = 'none'
} else if (data.media_type === 'video'){
document.querySelector('iframe').src = data.url
document.querySelector('img').style.display = 'none'
}
document.querySelector('h2').innerText = data.title
document.querySelector('p').innerText = data.explanation
Expand Down

0 comments on commit ec35cbd

Please sign in to comment.