Change the contents of a DOM element - Node.js DOM

Node.js examples for DOM:Element

Description

Change the contents of a DOM element

Demo Code

function html(name, content) {
  if(name != null) {
    console.log(name);/*from  www .j ava  2 s .  c om*/
    console.log(content);
    window.document.getElementByClassName(name).innerHTML = content;
  } else {
    alert(name);
  }
}

Related Tutorials