Home / Expert Answers / Computer Science / javascript-project-output-note-index-html-is-provided-for-you-you-may-change-the-styling-o-pa189

(Solved): JavaScript Project: Output: Note: index.html is provided for you. You may change the styling o ...



JavaScript Project:

1
Generate a table with 3 columns and 5 rows on clicking Generate HTML
button
Each cell must have values added dynamically

Output:

Cell 2
Cell 1
Cell 4
Cell 7
Cell 2
Cell 5
Cell 8
Cell 3
Cell 13 Cell 14.
Cell 6
Cell 9
Cell 10 Cell 11 Cell 12
Cell 15

Note: index.html is provided for you. You may change the styling on the HTML page but you are not allowed to add or remove any HTML elements. Addition of HTML elements must be done only through only JavaScript.  send code for site.js. 

Index.html code:

<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Lab 03 - INFO6122</title>

    <style>

      #btn {

        padding: 1.5rem;

        margin: 1 rem;

      }

      .cellEven {

        border-bottom: 3px solid #ccc;

        padding: 0.7em;

        margin: 1rem;

        background-color: wheat;

        cursor: pointer;

      }

      .cellOdd {

        border-bottom: 3px solid #ccc;

        padding: 0.7em;

        margin: 1rem;

        background-color: gray;

        cursor: pointer;

      }

      #message {

        padding: 1em;

        background-color: indianred;

        color: khaki;

        width: 200px;

        margin-bottom: 2em;

        display: none;

        font-size: 20px;

        font-weight: bold;

      }

    </style>

  </head>

  <body>

    <button id="btn">Generate HTML</button>

    <div id="message"></div>

    <script src="site.js"></script>

  </body>

</html>

1 Generate a table with 3 columns and 5 rows on clicking 'Generate HTML' button Each cell must have values added dynamically with text 'Cell cellnumber' where cellnumber is value from 1 to 15. Refer to screenshot below Cell 1 Cell 2 Cell 3 Cell 4 Cell 7 Cell 5 Cell 8 Cell 10 Cell 11 Cell 6 Cell 9 Cell 12 Cell 13 Cell 14 Cell 15 Also provide the styling of table cells as shown in the screenshot Note: Clicking on 'Generate HTML' for the first time should display the table. Clicking on the button second time onwards must display an alert stating the table has already been generated 2 Add mouseover event for each cells. Upon mouseover on any cells, a message should be displayed in a message box with the message being the content of the value of the cell Cell 2 Cell 1 Cell 4 Cell 7 Cell 2 Cell 5 Cell 8 Cell 3 Cell 13 Cell 14. Cell 6 Cell 9 Cell 10 Cell 11 Cell 12 Cell 15


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer: Here is the javascript file code: document.getElementById("btn").addEventListener("click", create_table) let message = document.getElementById("message"); let row; let cell; let btnClick = 1; function create_table() { if (btnClick
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe