Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript need javascript help [1] Reply To: need javascript help [1]

#156608
TheDoc
Member

@Alen – I’m not exactly sure what you’re solving with that pen…

Regardless, in your example you don’t need Javascript at all to accomplish what you’re trying to do. Styling is what CSS is for:

input[type="text"]:focus {
    background: red;
}

Also there’s a proper input type for passwords:

<input type="password" placeholder="Password" />

http://codepen.io/ggilmore/pen/51dd201291632b5d45c631c53d13bb89