Added option to hide the welcome message.

This commit is contained in:
deepjyoti30
2020-05-13 11:28:18 +05:30
parent 4c0a4b46c6
commit 8babc4becc
3 changed files with 8 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ window.onload = function() {
}
searchBarId = "search-bar-input"
messageDivId = "message"
messageId = "message-text"
otherContentId = "other-content"
userName = "Deepjyoti"
@@ -94,6 +95,11 @@ function parseAndCreate(jsonData) {
builtMsg = `Hello ${this.userName}` : builtMsg = `Hey ${this.userName}, ${builtMsg}!`
document.getElementById(messageId).textContent = builtMsg
// Check if welcome message is supposed to be disabled
disableMsg = jsonData["disableMessage"]
if (disableMsg)
document.getElementById(messageDivId).style.display = "none"
sqrs = jsonData["squares"]