forked from mdn/css-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
842d72f
commit 5802985
Showing
9 changed files
with
379 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var section = document.querySelector('section'); | ||
var editable = document.querySelector('.editable'); | ||
var textareaHTML = document.querySelector('.playable-html'); | ||
var textareaCSS = document.querySelector('.playable-css'); | ||
var reset = document.getElementById('reset'); | ||
var htmlCode = textareaHTML.value; | ||
var cssCode = textareaCSS.value; | ||
|
||
function fillCode() { | ||
editable.innerHTML = textareaCSS.value; | ||
section.innerHTML = textareaHTML.value; | ||
} | ||
|
||
reset.addEventListener('click', function () { | ||
textareaHTML.value = htmlCode; | ||
textareaCSS.value = cssCode; | ||
fillCode(); | ||
}); | ||
|
||
textareaHTML.addEventListener('input', fillCode); | ||
textareaCSS.addEventListener('input', fillCode); | ||
window.addEventListener('load', fillCode); |
Oops, something went wrong.