The type is an attribute. You can get it via the .attr() method:

var theType = $("#myInput").attr("type");

Setting the type is not supported across browsers. Rather, you'll have to
create a new input with the type you want. Ex:

$('<input type="password">').appendTo("form");

- Richard

On Thu, May 21, 2009 at 9:44 AM, Rodrigo Matheus <sis.rodr...@gmail.com>wrote:

> also need to know
>
> 2009/5/21 ash.finlay...@googlemail.com <ash.finlay...@googlemail.com>
>
>
>> Hi can anyone tell me how to set the 'type' of an html form element
>> using jquery?
>>
>> is there something like?
>> $("element").type("password");
>>
>> Many Thanks
>> Ash
>
>
>
>
> --
> Atenciosamente,
> Rodrigo Matheus
>

Reply via email to