Topic 4: Introduction to jQuery

Exercises

  1. Write a simple jQuery application which reads in two colours and some text from input boxes, and sets the background colour, text colour and text of a div to the values read in.
  2. Write a jQuery application to animate a div. Move it from x=0,y=0 to x=1024,y=768, and back again. Note that you will need to give your div a set of initial properties in the CSS, as otherwise, jQuery will be unable to read its properties. For example:
    #div1 
    {
        top: 0px;
        left: 0px;
        width: 400px;
        height: 400px;
        position: absolute;
    }
    
  3. Rewrite your AJAX code from week 3 to use jQuery, rather than Prototype and raw DOM parsing.