Advertisement
ShadowEmbrace

Untitled

Sep 11th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const header = document.getElementById('header')
  2. // header.innerHTML = 'New Title'
  3. header.style.color = 'red';
  4. header.style.fontSize = '24px';
  5.  
  6. const paragraphs = document.getElementsByTagName('p');
  7. console.log(paragraphs)
  8.  
  9. const highlightedElements = document.getElementsByClassName('highlight')
  10. console.log(highlightedElements)
  11.  
  12. // const firstParagraph = document.querySelector('p')
  13. // const allParagraphs = document.querySelectorAll('p')
  14.  
  15. const list = document.getElementById('list')
  16. const newElement1 = document.createElement('li')
  17.  
  18. newElement1.textContent = 'new element'
  19. newElement2 = document.createElement('li')
  20. newElement2.textContent = 'prepend element'
  21.  
  22. list.appendChild(newElement1);
  23. list.prepend(newElement2)
  24.  
  25. // const firstItem = list.firstElementChild
  26. // list.removeChild(firstItem)
  27.  
  28. console.log(window.innerHeight)
  29. console.log(window.innerWidth)
  30.  
  31. // window.alert('Attention')
  32.  
  33. // window.open("https://stackoverflow.com/questions/2007357/how-to-set-dom-element-as-first-child", "New Window", "width=500, height=500")
  34.  
  35. console.log(navigator.appVersion)
  36. console.log(`screen width - ${screen.width}`)
  37. console.log(`screen height - ${screen.height}`)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement