Last active
February 3, 2019 08:11
-
-
Save ervinne13/42723490c861eaca3ec10b6a7df15179 to your computer and use it in GitHub Desktop.
Refactoring JavaScript: Separation of Concerns - Markup Code on JS
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
// ... variable declaration and setting of widgetID, widgetTitle, etc. | |
let widgetText = "JavaScript is Quirky"; | |
let widgetHTML = '<div id=' + widgetId + '>' + | |
'<h2 id="' + widgetTitleId + '">' + widgetTitle + '</h2>' + | |
'<div id="' + widgetContentId + '" style="' + widgetContentStyles + '">' + | |
widgetText + | |
'</div>' + | |
'</div>'; | |
document.getElementById("widget-container").innerHTML = widgetHTML; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment