Usage for Attr

Usage for Attr

I am trying to this on a input tag that is a type password and changing it to text, but the below line crashes my script but it work when i use prop instead anyone know why?


does not work
  1. $(selector).attr('type','text');


works
  1. $(selector).prop('type','text');