You are on page 1of 1

Remember selector "li" vs element "<li>". Selector changes all.

Element only aff


ects one.
0. val, click, animate (moves around screen), fadeIn, fadeOut, fadeTo,
1. keyup, text (continuous change to stream on text on input)
2. submit (react to form submit, only works on forms)
3. appendTo (attaching new element, create with <li> not "li")
4. toggle, toggleClass, next, find (make things appear and disappear, find eleme
nt in block so only 1 is affected)
5. addClass, removeClass (for styling, class is in CSS file)
6. $(document).on(event, target, function)
looks like this intuitively: $(target).event(function)
used when element not on page at start
parent, remove, [element].checked (for boolean state of checked)
Annyang:
var add = function(item) {
};
if(annyang){
var commands = {'add *item': add};
annyang.addCommands(commands);
annyang.start();
}
commands parameter is a string. words after * are passed into function as variab
le.

You might also like