Adding event listener on the page

Suppose you have an input field and you need FilerTag function be performed each time user types a character. Below are two approaches for this.

Native browser approach:


if (a.addEventListener) {a.addEventListener("keyup", FilterTags, false)} // firefox
else if (a.attachEvent) {a.attachEvent("onpropertychange", FilterTags)} // ie

YUI approach:

YAHOO.util.Event.addListener(a, "keyup", FilterTags);

Comments

Popular posts from this blog

Conceptual design

How do I use InVision

Using Trello and Confluence to manage UX design project. Part 1