Build a Job Application Form - Build a Job Application Form

Tell us what’s happening:

You should use the :checked pseudo-class on radio buttons to change the text color of the associated label when the option is selected.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Job Application Form</title>
    <link rel="stylesheet" href="lab12styles.css">
</head>
<body>
<div class="container">
    <form>
        <input type="text" id="name" name="name" placeholder="Full Name" required>
        <input type="email" id="email" name="email" placeholder="Email" required>
        <select id="position">
            <option value="" disabled selected>Select Position</option>
            <option value="developer">Developer</option>
            <option value="designer">Designer</option>
            <option value="manager">Manager</option>
            <option value="analyst">Analyst</option>
        </select>
        <fieldset class="radio-group">
            <input type="radio" name="availability">
            <label for="availability">Available</label>
            <input type="radio" name="experience">
            <label for="experience">experience</label>
            <input type="radio" name="gender">
            <label for="gender">gender</label>
        </fieldset>
        <textarea id="message"></textarea>
        <button type="submit">Submit</button>
    </form>
</div>
</body>
</html>
/* file: styles.css */
input:focus, textarea:focus{
border-color: rgb(116, 248, 0);
}
input:invalid, select:invalid, textarea:invalid{
border-color: red;
}
input:valid, select:valid, textarea:valid{
border-color: green;
}
button:hover{
background-color: rgb(0, 255, 0);
}
.radio-group input[type="radio"]:checked{
    border-color: rgb(0, 255, 0);
    background-color: rgb(0, 255, 0);
    box-shadow: 0px 4px 8px rgba(0, 255, 0, 0.5);
}
.radio-group input[type="radio"]:checked+ label{
    color: red;
  }
input:first-of-type{
    border-radius: 10px 0 0 10px;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15

Challenge Information:

Build a Job Application Form - Build a Job Application Form
https://www.freecodecamp.org/learn/full-stack-developer/lab-job-application-form/lab-job-application-form

you need to have the label associated with the input, you are missing that

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.