Answers for "append html inside head"

1

js add more text to element

document.getElementById("p").textContent += " This is the text from javascript.";

<p id ="p">This is the text from HTML.</p>
Posted by: Guest on June-18-2020
0

javascript add div to body with class

// correct me if im wrong
var MainDiv = document.createElement('div');
var ChildDiv1 = MainDiv.createElement('div');
ChildDiv1.className = 'contextmenu_contextMenu_3_a2Z contextmenu_ContextMenuFocusContainer_2thYU';
ChildDiv1.tabIndex = "0";
ChildDiv1.style = "visibility: visible; bottom: 56px; right: 68px;"
var ChildDiv2 = ChildDiv1.createElement('div');
ChildDiv1.className = 'contextmenu_contextMenuContents_1yyTu';
var DivButton1 = ChildDiv2.createElement('div');
DivButton1.className = 'contextmenu_contextMenuItem_CBC-y contextMenuItem';
DivButton1.value = "Upload an Image";
var DivButton2 = ChildDiv2.createElement('div');
DivButton2.className = 'contextmenu_contextMenuItem_CBC-y contextMenuItem';
DivButton2.value = "Share Your Trade Offer URL";
document.body.appendChild(MainDiv);
Posted by: Guest on September-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language