LD09: Intro to DOM Manipulation due Thu 02 Nov 13:20

\begin{purpose}
In this assignment you will:
\begin{itemize}
\item Modify ex...
...pply jQuery commands to an interactive application
\end{itemize}
\end{purpose}

Preparation for Lab Day

In preparation for lab day, do these actions:

  1. In your webspace create a directory named hw09 and copy https://josephus.hsutx.edu/classes/w1/source/dom_manipulation/manip6.html into it. Verify that the document works as expected.

  2. Let's turn our attention to the bottom section of the document that contains two side-by-side panels, a text box, a check box and two button. The panels are found in the code in a section with an id of “panels” and the form elements are in a nav element. Find those sections in the code.

  3. Create an event handler that will add whatever text is entered in the text box to the bottom of the left panel when the “Add Text to Left Panel” button is clicked. If you are having trouble getting started you should review the progression of documents (manip1.html, manip2.html, etc.) taking care to read and understand the comments and code.

  4. Once you have it working, commit your work and push it to bitbucket.

On Lab Day

  1. Begin by showing the instructor your pre-lab work.

  2. You will continue to practice working with event handlers in the manip6.html document you worked with in the prelab assignment. Start by adding functionality from the checkbox. If the checkbox is checked and the user clicks the “Add Left” button then the text in the box should be added to the left panel but the text should be enclosed in an editable text box.

  3. Once you get the code working for the left panel, duplicate it for the right panel making careful note of changes that were necessary to make it work.

  4. Now try to combine the code that handles the left and right buttons so that they work as a single function. Use the concept of event propagation to listen for a click on the nav element and then make sure that one of the buttons was clicked. Try to make the code as short as you can by eliminating multiple lines that match each other except for a small difference.

  5. Once you have both buttons being handled efficiently in a single handler you are ready to commit and push your work.

  6. Show your work to the instructor. If you finish early you can start work on the homework assignment.