Behaviour promotes itself as "the missing link for your AJAX apps". It allows you to use CSS selectors (like id or class) to apply Javascript behaviors to your HTML elements.

No more embedding Javascript tags in your HTML. What Behaviour (note the British spelling) does is allow you to define rules where you associate javascript functions with CSS selectors.

Let's look at an example (from their site):
Instead of writing:

  • Click me to delete me
  • With Behaviour we can write:

    
    

    There is no Javascript embedded in HTML. The actual Javascript function is defined and associated separately.

    var myrules = {
    	'#example li' : function(el) {
    		el.onclick = function() {
    			this.parentNode.removeChild(this);
    
    		}
    	}
    };
    
    Behaviour.register(myrules);
    

    It worked pretty well in my tests. Very much recommended unless you are into code obfuscation. You can download it here.