Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict'
- //const b = document.getElementById("berry");
- //console.log(b);
- const c = document.querySelector('ul');
- c[4].style.backgroundColor = "red";
- console.log(c[5]);
- const orange = c[2];
- orange.backgroundColor = "orange";
- const HTMLcollection = document.getElementsByTagName('li');
- console.log(HTMLcollection);
- for(let i = 0; HTMLcollection.length > i, i++;){
- let p = HTMLcollection[i].innerHTML;
- let v = HTMLcollection[i];
- if( p === "Pear"){
- p.backgroundColor = "green";
- }
- v.style.width = "100px";
- v.style.listStyle = "none";
- }
- const all = document.querySelectorAll('li');
- console.log(all);
- all.forEach(item) => {
- console.log(item);
- item.style.borderStyle = "dotted double";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement