jQuery clear input[type=password]
Try using the :password
selector as it will make your code shorter:
$(':password').val('');
Also your initial code should work. Your problem is somewhere else. Unfortunately as you haven't stated in what context and how this is called or as you haven't explained what it doesn't work mean I cannot help you further.
Try with
$("input[type='password']").val('');