In sample code of the yui library, I see this notation:
var obj = document.getElementById("coffee_msg"); obj.style.display = 'block'; As obj is only used once, I would rather prefer this:
document.getElementById("coffee_msg").style.display = 'block'; Is there any reason why the first notation is used in the yui library and many other places? Are there incompatibilities with certain browsers?