$("#foo")[0].nodeName;

On Mar 25, 8:15 am, Brad <nrmlcrpt...@gmail.com> wrote:
> I'm working on a page that dynamically changes many form elements.
> Because of the way that different browsers style disabled or readonly
> text inputs, I'm swapping the input with a span that displays more
> consistently. I don't need to submit those fields. However, when I do
> this the affected element's ID does not change. There are also some
> other cases where a control may change from a free text input to a
> select menu and vice versa, but again with the same ID.
>
> If there a way for me to figure out what the type of element for a
> matched ID? For example if
>
>     $("#foo")
>
> matches
>
>     <input id="foo" ...>
>
> I'd like to know it is an input, but if
>
>     $("#foo")
>
> matches
>
>     <span id="foo" ...>
>
> I'd like to know it is a span?

Reply via email to