textcontent in javascript
snippet in javascript

textcontent js

user5340


 var x =
 document.getElementById("myBtn").textContent; 

textcontent in javascript

user1239

// The textContent property sets or returns the text content of the specified node

// read text content from id .. 
let text = document.getElementById('id').textContent;
console.log(text);

// change text content of id .. 
document.getElementById('id').textContent = "text is changed now !";