This version is old school.
Please find jQuery plugins on npm.
jQuery Disable Autocomplete
by Joe Johnson
This jQuery plug-in enforces the autocomplete=off HTML attribute on password (and other) fields. Recent browsers have chosen to ignore this attribute in favor of user preferences. However, some financial (and other) institutions may have good reasons to enforce this practice.