INFM 603
Information Technology and Organizational Context
Spring 2015
Assignment H5


Okay, now its time to put what we have learned together and do something more complex than we could easily manage if we had just used structured programming. For this we need an object, and one object that is very important to us is the Document Object Model (DOM), which we discussed in class. So we want to access an HTML page as a DOM, grab an element from that DOM, change it, and write it back in its changed form. And we want to do this in a way that is fairly general, so that if the page is different in the future, our changed page will also be different. So we'll play "hacker" a bit. Again, the goal isn't to learn how to hack (!), but rather to learn how to work with objects in general, and with the DOM in particular.

  1. Create a Web page with a JavaScript program that uses the DOM to get the content of a some text inside a <div> with id="footer", and reverses the order of the characters of the text in that string. If there is a lot of text inside the footer <div> you can reverse all of it, or any (nontrivial) subset of it (e.g., a line or so). Your JavaScript program should be designed in such a way that it will reverse the order of any characters that might be put there there in the future using similar HTML tags, not just those that are there now. For simplicity, you should simply make a copy of the page you want to modify and insert your JavaScript code into that page.
  2. Call your page hw5.html, put it in the usual place, and link it as usual.

Doug Oard
Last modified: Thu Feb 26 16:54:40 2015