On Oct 23, 11:51 am, jcoglan <[EMAIL PROTECTED]> wrote: > This might be kind of a niche thing, but anyways... I'm trying to > extend jQuery so that if $() returns a single element, you can get the > element's properties directly on the jQuery instance. e.g. > $('#something').tagName // "DIV"
What happens if the selector _doesn't_ return just one element? Your statement will then fail, right? You're going to try to use your attribute or method regardless of what the selector comes back with, which opens you up to potential problems. If you're positive you'll get an element back, why not just do: $('#something')[0].tagName ? Matt Kruse