In this CCBP Login Dynamic Web Application I can’t getting the above JS functionalities
this cases are not executed please help
<!DOCTYPE html>
<html>
<head>
<title>Hello html</title>
</head>
<body>
<label for="Name">Name name:</label>
<input type="text" id="Name" name="name" class="text"><br><br>
<label for="Password">Password :</label>
<input type="text" id="Password" name="password" class="text"><br><br>
<button class="btn btn-primary" type="button">
click
</button>
</body>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script>
$('.btn').click(function(){
let inputs = $('.text');
for (let i = 0; inputs.length; i++)
if(inputs[i].value.length === 0)
inputs[i].value = "Fill in the required details";
});
</script>
</html>
Comments
Leave a comment