Created
April 14, 2024 05:36
-
-
Save madhoshyagnik/be96f4915c44af61e01aaa0a6d948e30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const para = document.querySelector('p'); | |
// para.innerText += 'ninjas are awesome'; | |
// console.log(para.innerText); | |
const paras = document.querySelectorAll('p'); | |
// paras.forEach(element => { | |
// element.innerText += ' new text'; | |
// console.log(element.innerText); | |
// }); | |
const content = document.querySelector('.content'); | |
const people = ['mario', 'luiji', 'yoshi']; | |
people.forEach(element => { | |
content.innerHTML += `<p> ${element}</p>`; | |
}); | |
Author
madhoshyagnik
commented
Apr 14, 2024
•
const link = document.querySelector('a');
link.setAttribute('href', 'https://www.netninja.dev');
link.innerText = 'The net ninja uk website';
console.log(link.getAttribute('href'));
const mssg = document.querySelector('p');
console.log(mssg.getAttribute('class'));
mssg.setAttribute('class', 'success');
console.log(mssg.getAttribute('class'));
mssg.setAttribute('style', 'color: green;');
//adding css on top
const title = document.querySelector('h1');
console.log(title.style.color)
title.style.margin = '50px';
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment