How-to articles, tricks, and solutions about INPUT

Asking the user for input until they give a valid response

To ask the user for input and repeat the prompt until they give a valid response, you can use a while loop and use a try-except block to catch any errors that may occur when trying to convert the user input to the desired data type.

Getting Keyboard Input

To get keyboard input in Java, you can use the Scanner class from the java.util package.

How to Add an HTML Button that Acts Like a Link

There are several ways to place a clickable button on a webpage that will be linked to another page of your website. You can add inline onclick event to HTML button tag, or input tag.

How to Add an Onclick Effect with HTML and CSS

In this snippet, we’ll demonstrate how to add an onclick event in CSS. The best way of creating an onclick effect is using the well-known checkbox hack.

How to Align a Checkbox and Its Label Consistently Cross-Browsers

Checkbox is one of HTML forms that is used on every website. This tutorial will show how to align checkboxes and their labels consistently across browsers.

How to Align Labels Next to Inputs

In this snippet, you’ll learn how to align <label> elements next to <input> elements. Align labels to the right and left of inputs by using CSS properties.

How to Align the Placeholder Text of an Input Field in HTML

The ::placeholder pseudo-element allows styling the placeholder text of a form element. Here you will find out how to align an input field’s placeholder text.

How to Allow Only Positive Numbers in the Input Number Type

In this snippet, we’ll demonstrate how to allow only positive numbers in the input number type. You can use the “min” attribute to specify restrictions.

How to Allow the File Input Type to Accept Only Image Files

In this tutorial, we’ll show how to allow the file input type to accept only image files or certain image file extensions. Use the HTML “accept” attribute.

How to Apply CSS Style to the Element Name

In this snippet, we’re going to demonstrate how you can apply CSS styles to the name of the element. For that, you can use attribute selectors. See examples.

How to Assign a Checked Initial Value to the Radio Button

In this tutorial, find out how you can assign a checked initial value to the radio button with HTML. To achieve that goal, you need to use the checked attribute.

How to Change Default Text Selection Color Using CSS

Use the CSS ::selection selector to change the default highlight color while selecting texts. Use only CSS and do cool tricks to have a better user experience. All with examples.

How to Change Selected Value of a Drop-Down List Using jQuery

In this tutorial, you will read and learn about jQuery methods that are used to change the selected value of a drop-down list via its text description.

How To Change the Color of an HTML5 Input Placeholder Using CSS

Learn How To Change the Color of an HTML5 Input Placeholder with CSS with W3docs tutorial. Try the code examples yourself. Fast solution.

How to Change the Input and Button Images with CSS

It may be difficult to style buttons, especially when we need to change them to images. You can change buttons to images with <input> and <button> elements.

How to Check a Radio Button with jQuery

Read the tutorial and learn the right way of checking a radio button with jQuery. Also, read how to handle with different versions of jQuery while checking.

How to Check and Uncheck Checkbox with JavaScript and jQuery

In this tutorial, you will read and learn about several JavaScript and jQuery methods for checking and unchecking a checkbox. Choose the best one for you.

How to Create a Fullscreen Image Slider with Pure CSS

Creating a fullscreen slider is an easy thing to do with the help of HTML and CSS properties. Read the tutorial and create your own cool fullscreen slider easily.

How to Create a Glowing Border Around an Input Field

In this snippet, we’re going to demonstrate some examples of creating a glowing border around an input field. For that, you need to use some CSS properties.

How to Create a Responsive Login Form in Navbar with CSS

Apparently, all websites have login forms and millions of people log in every day. Create a login form in navbar for your website in an easy way using just HTML and CSS.

How to Create Button with Line Breaks

Learn different ways of how to create buttons with line breaks. See also how to give styling to them with examples.

How to Create Contact Form With CSS

Create a contact form for collecting user’s contact details and opinions about your website. Follow the steps and create a contact form with CSS in a simple way.

How to Create Custom Checkboxes and Radio Buttons

Learn how to create and style custom checkboxes and radio buttons. Also set custom images as checkboxes and radio buttons. See all with examples.

How to Create Mailto Forms

Learn about how to create a Mailto forms with examples. See also the advantages that Mailto forms can have.

How to Create Range Slider With HTML5 and jQuery

HTML5 range input type allows creating range sliders. Read the tutorial and learn a simple solution including a jQuery code to achieve the desired result!

1 2 3