Question: For some reason IE9 returns "text" when writing the following code
Any ideas why. Other browsers return email

HTML

```
<input type="email">

```

javascript

```
alert($(input).attr('type'))

```

Answer: 
That is because IE9 does not support email, thus it ignores the values and resets it to the default value it supports... text.
> 
> For some reason IE9 returns "text" when writing the following code Any
>  ideas why. Other browsers return email
> 
> 
> HTML
> 
> 
> 
> 

In a browser that is conformant with W3C standards (where *element* is a reference to the input element), then:

```
// Get the value of the HTML type attribute
element.getAttribute('type') // email

// Get the value of the DOM type property
element.type                 // email or text, depending on whether 
                             // type email is supported or not

```

*getAttribute* returns the literal value of the associated attribute. The DOM property returns the actual value that the DOM property is set to (they may be, and often are, different values). IE 9 conforms to the standard—it doesn't support *email* so the DOM property returns "text", while *getAttribute* returns "email".

> 
> javascript
> 
> 
> 
> ```
>   alert($(input).attr('type'))  // email in jQuery version 1.6 and higher
>   alert($(input).prop('type'))  // text  in jQuery version 1.6 and higher
> 
> ```
> 
> 

According to [jQuery documentation](http://api.jquery.com/attr/), the *attr* method returns the *attribute* value, and it does in version 1.6 and higher. To get the DOM property, use [*prop*](http://api.jquery.com/prop/). Prior to that, jQuery authors tried to second guess what developers actually wanted and *attr* returned either the attribute or DOM property value based on some unexplained logic.