This Gist was automatically created by Carbide, a free online programming environment.
Last active
August 27, 2016 17:04
-
-
Save FrankFang/a72c45e034bf051d8ebef02715923179 to your computer and use it in GitHub Desktop.
DOM Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///DOM example | |
var h = 100 | |
var div = document.createElement('div') | |
div.style.height = h + 'px' | |
div.style.width = '100px' | |
div.style.background = "#3cbd63" | |
var div2 = document.createElement('div') | |
div2.style.height = '10px' | |
div2.style.width = '10px' | |
div2.style.background = "red" | |
div.appendChild(div2) | |
div |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment