Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
- <div class="container">
- <a class="navbar-brand" href="project.html">Occupational Stress Monitor</a>
- <form class="form-inline">
- <button id= "record-button" class="btn btn-md btn-light" type="button" data-toggle="tooltip" data-placement="top" title="Click Here to Record Stress">Record</button>
- </form>
- </div>
- </nav>
- <h1>Stress Log</h1>
- <table>
- <tr>
- <th class="heading">Day of the Week</th>
- <th class="heading">Stress Level</th>
- <th class="heading">Cause of Stress</th>
- </tr>
- <tr>
- <td>Monday</td>
- <td id="Monday"></td>
- <td id="stressor1"></td>
- </tr>
- <tr>
- <td>Tuesday</td>
- <td id="Tuesday"></td>
- <td id="stressor2"></td>
- </tr>
- <tr>
- <td>Wednesday</td>
- <td id="Wednesday"></td>
- <td id="stressor3"></td>
- </tr>
- <tr>
- <td>Thursday</td>
- <td id="Thursday"></td>
- <td id="stressor4"></td>
- </tr>
- <tr>
- <td>Friday</td>
- <td id="Friday"></td>
- <td id="stressor5"></td>
- </tr>
- </table>
- var record = document.getElementById("record-button");
- var person = ["Good", "Ok", "Bad"];
- record.onclick = function (){
- var person = prompt ("How are you feeling today?-Good,Ok or Bad");
- document.getElementById("Monday").innerHTML = person;
- if (person !== "Good"){
- var cause = prompt ("What is causing your stress?");
- document.getElementById("stressor1").innerHTML = cause;
- }
- }
Add Comment
Please, Sign In to add comment