JS - Checkbox Example

Size
2,002 Kb
Views
34,408

How do I make an js - checkbox example?

What is a js - checkbox example? How do you make a js - checkbox example? This script and codes were developed by Colleen Van Lent on 26 August 2022, Friday.

JS - Checkbox Example Previews

JS - Checkbox Example - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>JS - Checkbox Example</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
</head>
<body>	<form action="http://www.intro-webdesign.com" method = "GET">	<fieldset> <legend>Form Verification</legend> <label for ="fName">First Name:</label> <input type = "text" name = "fName" id = "fName" required><br/>	<label for = "lName">Last Name:</label> <input type = "text" name = "lName" id = "lName" required><br/> <label for = "yesNick">Nickname?:</label> <input id="yesNick" name="yesNick" type="checkbox" value="yes" onchange= "nicknameFunction()"/>	<br/> <div id = "nick"> <label for = "nickname">Nickname:</label> <input type = "text" name = "nickname" id = "nickname"><br/> </div> <input type = "submit" value = "Verify"/> </fieldset>
</form>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>

JS - Checkbox Example - Script Codes CSS Codes

input{	border:1px solid black;	}	input:focus{	background-color: #E6E6E6;	}	#nick{	margin-left: 4%;	display:none;	width: 50%;	}

JS - Checkbox Example - Script Codes JS Codes

function nicknameFunction(){	if (document.getElementById('yesNick').checked){ document.getElementById('nick').style.display="inline"; document.getElementById('nickname').setAttribute('required',true);	}	else{	document.getElementById('nickname').removeAttribute('required');	document.getElementById('nick').style.display="none";	}	}
JS - Checkbox Example - Script Codes
JS - Checkbox Example - Script Codes
Home Page Home
Developer Colleen Van Lent
Username ColleenEMc
Uploaded August 26, 2022
Rating 3.5
Size 2,002 Kb
Views 34,408
Do you need developer help for JS - Checkbox Example?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Colleen Van Lent (ColleenEMc) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!