JSFiddle - React, Tailwind, and code Playground

by Daniel Hall

HTML

<div id="inputWords">
 <ul>
   <li>
      <input type="text" id="adj1">
      <br>do you ever say wimp
			if you do type in I said wimp
      </li>
      <!-- put other input fields here -->
      
      </ul>
</div>
<div id="story">

</div>
<button id="replaceButton">all done?</button>

CSS

body {
    font-family: "Comic Sans MS";
		background-color: #CD09FF;
}
#inputWords {
    float:left;
    width: 45%;
}
ul {
     list-style-type: none;
     padding: 0px;
     margin: 0px;
}
li {
   line-height: 2em;
   text-transform: uppercase;
   margin-top: 8px;
}
input[type=text] {
    border-width: 0 0 1px 0;
    border-color: #333;
}
#buttonDiv {
    text-align: center;
}
#replaceButton {
    margin-top: 30px;
    width: 200px;
}
#story {
    margin-top: 12px;
    width: 45%;
    border: 1px dashed blue;
    padding: 8px;
    float: left;
}
.replacement {
    text-decoration: underline;
    text-transform: uppercase;
}

JavaScript

var replaceButton = document
   .getElementById("replaceButton");
replaceButton.addEventListener("click",replaceIt);

function replaceIt() {
    var storyDiv = document.getElementById("story");
    var adj1 = "<span class='replacement'>"+ document
   .getElementById("adj1").value + "</span>";
     /* Insert  more varible definitions here */
     var  theStory = "<h1>NOW ARE YOU A WIMP OR ARE YOU NORMLE</h1>";
     theStory += "you said you are a " + adj1 +  "you if it is yes you are a wimp ";
     /* Put the the story here, using the +=
    operator */
     storyDiv.innerHTML = theStory;
}