Collection of free vanilla JavaScript input text code examples

Welcome to our collection of JavaScript examples! In this meticulously curated compilation, we have assembled a diverse range of JavaScript code snippets that showcase the flexibility and power of this dynamic programming language.

Clear Input Field

Author:
Aaron Iker | December 21, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
gsap.js

Password Field

Author:
Aaron Iker | December 16, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
gsap.js

Color Changing Cursor in TextArea

Author:
Timothy Carambat | November 24, 2020
Made with:
HTML / CSS / JS

About a code

Changing the color of an input cursor as it reaches the max length attr of a textarea.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
tailwind.css

Form Focus

Author:
Chris Smith | August 19, 2020
Made with:
HTML / CSS (SCSS) / JS

About a code

Concept for narrowing focus when completing a form.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Neumorphic Show/Hide Password Input Field

Author:
mayur punjabi | August 1, 2020
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

CYBERTYPE

Author:
Manan Tank | May 3, 2020
Made with:
CSS / JS

About a code

A hyper reactive typer.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Input Type Password

Author:
Gabriele Corti | February 23, 2020
Made with:
HTML / CSS / JS

About a code

Animate SVG paths with CSS transitions. Use grid properties to lay the elements of a form.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Email Validation Animation

Author:
Aaron Iker | February 19, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Password Generator

Author:
Vast Rideside | February 17, 2020
Made with:
HTML / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
snap.svg.js

Password Validate Animation

Author:
Milan Raring | February 8, 2020
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Password Input Light

Author:
Ryan Mulligan | December 26, 2019
Made with:
HTML (Pug) / CSS (SCSS) / JS

About a code

Let the light reveal your password! A silly experiment using a show/hide toggle on a password input.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Password Strength Validator UI

Author:
Natalia Davydova | December 25, 2019
Made with:
HTML (Pug) / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
bootstrap.css, font-awesome.css, bootstrap.js

Birthday Input with Zodiac

Author:
Aaron Iker | December 19, 2019
Made with:
HTML / CSS (SCSS) / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Image Password Strength

Author:
Florin Pop | November 1, 2019
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
tailwind.css

Animated Input Labels

Author:
Jarrod Thibodeau | July 17, 2019
Made with:
HTML (Pug) / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
tweenmax.js, splitting.js

Droppy Woppy Input

Author:
Steve Gardner | October 30, 2018
Made with:
HTML / CSS (SCSS) / JS (TypeScript)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
three.js, cannon.js, tweenmax.js

Floaty Labels

Author:
David A. | April 10, 2019
Made with:
HTML / CSS (SCSS) / JS (Babel)

Compatible browsers:
Chrome, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Bump Name

Author:
Mikael Ainalem | December 25, 2018
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
bezier-easing.js

Talking Ghost Chat Input

Author:
Jason Yeung | October 3, 2018
Made with:
HTML (Pug) / CSS (SCSS) / JS (Babel)

About a code

A little concept of a ghost reading your input text and "hiding" when you are typing out your message.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Material Design Like Form Input Text Fields

Author:
Tero Auralinna | September 16, 2018
Made with:
HTML / CSS (SCSS) / JS (Babel)

About a code

This example demonstrates how to create Material Design like form input text fields.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
bootstrap-reboot.css, bootstrap-grid.css

Show/Hide Password

Author:
@keyframers | August 28, 2018
Made with:
HTML / CSS (SCSS) / JS

About a code

David Khourshid and Stephen Shaw rapid-fire build several text animations with Splitting.js and CSS!

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
splitting.css, splitting-cells.css, splitting.js

Push to Hide

Author:
Elior Tabeka | May 28, 2018
Made with:
HTML / CSS (SCSS) / JS (TypeScript)

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Autocomplete

Author:
Trevor Eyre | March 17, 2018
Made with:
HTML / CSS (SCSS) / JS (Babel)

About a code

Demonstration of a fully accessible autocomplete/search component in vanilla JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
fuse.js

Tags Input

Author:
Julien Dargelos | January 15, 2017
Made with:
HTML / CSS (Sass) / JS

About a code

Tags input in JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
-

Input

Author:
Shehab Eltawel | June 26, 2016
Made with:
HTML / CSS / JS

About a code

Input with Snap.svg & validation.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
snap.svg.js
Text Mask

Text Mask

Author:
Text Mask | May 22, 2016

Animated UI Text Input

Author:
Shehab Eltawel | May 12, 2016
Made with:
HTML / CSS / JS

About a code

Expanding text input in JavaScript.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Pixie Dust Input

Author:
Rik Schennink | May 6, 2016
Made with:
HTML / CSS (SCSS) / JS

About a code

Type to have the input generate pixie dust.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Dynamic 3D Confetti Text

Author:
Rachel Smith | September 21, 2015
Made with:
HTML / CSS / JS

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
yes
Dependencies:
three.js

Autosize Input

Author:
Yuan Qing Lim | June 14, 2015

Fancy Input Field

Author:
bartekd | January 31, 2013
Made with:
HTML / CSS / JS

About a code

Trying to make input field that is a bit more fancy than the regular boring box.

Compatible browsers:
Chrome, Edge, Firefox, Opera, Safari
Responsive:
no
Dependencies:
-

Discover Our Extensive Snippet Library

This heading suggests that your website provides a wide variety of snippets across different technologies, encouraging users to explore and use these resources for their development projects.

HTML Snippets.

Explore a collection of HTML snippets designed to streamline your web development process. From basic structures to complex elements.

CSS Snippets.

Discover powerful CSS snippets that help you style your web pages with ease. Whether you need layout solutions, animations

JavaScript Snippets.

Enhance your website's interactivity with our JavaScript snippets. From DOM manipulation to advanced algorithms

Bootstrap Snippets.

Leverage the power of Bootstrap with our collection of snippets. Quickly integrate responsive design components

Tailwind Snippets.

Speed up your development process with Tailwind CSS snippets. These utility-first CSS snippets enable you to

jQuery Snippets.

Simplify your JavaScript development with jQuery snippets. Easily perform common tasks like event handling, animations

React Snippets.

Build robust, component-based user interfaces with our React snippets. From state management to lifecycle methods,

Vue Snippets.

Streamline Vue.js development with our collection of snippets for creating components, managing state, and handling events.

Ready to set your Brand ablaze?

Let's craft a visual identity that ignites passion and loyalty. ✨