jquery - How can I hide an element? -


i'm trying disable browser 'save password' functionality (my previous question). that, added new input type="password" field inside form, code:

<form method="post" action="yoururl">     <input type="password" style="display:none"/><!-- making "save password" disable -->     <input type="text" name="username" placeholder="username"/>     <input type="password" name="password" placeholder="password"/> </form> 

note: using autocomplete=false won't work on modern browsers. please don't suggest it. in fact i'm trying use this approach.

well what's problem? when hide useless input display:none, doesn't work (i mean still saving password option there.). when hide useless input visibility:hidden, works.

as know visibility property takes space on page don't want that. how can hide useless input both hide , remove space?

  • display:none good, destroys purpose of adding useless input.
  • visibility:hidden isn't because takes space on page.

so there other way?

there many possible solutions.

one might be:

input[type='password']:nth-of-type(1) { visibility: hidden; width: 1px; height: 1px; } 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -