This div displayed when the link was clicked. Whenever the link is clicked, the display of the two divs are swapped. Every time the link is clicked, the divs are swapped. The two divs need to be next to each other, one above the other. It can be made to appear and disappear, change size, and move to a new location on the fly. Posted by 2 years ago. See online demo and code. All gists Back to GitHub Sign in Sign up Sign in Sign up {{ message }} Instantly share code, notes, and snippets. onclick change div content. 1. document.getElementById("demo").style.color = "red"; } . change position: absolute; left: -200em; } Note the use of ems which pushes the content further off-screen the … Change background Color Button with onClick in reactjs - change-background-color-button-with-onclick-in-reactjs.markdown. Created Oct 13, 2018. How to Change Height of Div in JavaScript Example 1: In this example, the DIV is positioned at the end of the document. Active 7 years, 5 months ago. Method 1: This method uses id attribute of textarea with value property to change the content of