DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

innerHTML, outerHTML and other properties #20

// Chapter 8 Event & Other DOM Proterties
// console.dir founction
// console.log show the element as an element iwth its properties

// tag name / node Name
// Used to read the tag of an element
// tagname --> only inisist for element node
// nodename --> defined for any node (text , comment ,etc)

// Innter HTML and Outer HTML
// The inner HTML property allow to get the HTML inside the element as a string void for the element node only ***

// The outer HTML property contains the full HTML inner HTML + the element itselft

// inner HTML is valid only for elements nodes . For other node type we can use nodevalue or data

// text content
// provide acces to the text inside the element , only txt ,minus all tags

// The Hidden Property
// The hidden attribute and the DOM property specfies wheather the element is visible or not

let x = document.getElementsByTagName('span')[0]
let y = document.getElementsByTagName('span')[0]

// first.innerHTML

// first.innerHTML = "hey I am italic"

// first.outerHTML

// first.outerHTML = "



// console.log(document.body.textContent)

// first.hidden = false

Top comments (0)