Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript document.createElement add function

var newTH = document.createElement('th');
newTH.innerHTML = 'Hello, World!';
newTH.onclick = function () {
    this.parentElement.removeChild(this);
};

var table = document.getElementById('content');
table.appendChild(newTH);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #add #function
ADD COMMENT
Topic
Name
9+4 =