Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // dom selection
- const judul = document.getElementById('judul');
- judul.style.color = 'red';
- judul.style.backgroundColor = '#ccc';
- judul.innerHTML = 'Sofronius';
- // documenttagname
- const p = document.getElementsByTagName('p');
- for (let i = 0; i < p.length; i++) {
- p[i].style.backgroundColor = ' lightblue';
- }
- const h1 = document.getElementsByTagName('h1')[0];
- h1.style.fontSize = '50px';
- // class name
- const p1 = document.getElementsByClassName('p1')[0];
- p1.innerHTML = 'ini diubah boss';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement