Menu

Select only one checkbox from a group of checkboxes

Create a group of checkboxes and allow only one selection. Here is the sample code for of creating checkbox using simple HTML and JavaScript.


HTML code

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
  <script>
  var checkboxChecked;
  document.addEventListener('input',(e)=> {
    if(e.target.getAttribute('name')=="termsCondition") {
      if(checkboxChecked)
        checkboxChecked.checked=false;
      }
      e.target.checked=true;
      checkboxChecked=e.target;
  })
  </script>
</head>
<body>
  <p>Select only one checkbox from a group of checkboxes.</p>
  <input type="checkbox" name="termsCondition" value="1" /> 1
  <input type="checkbox" name="termsCondition" value="2" /> 2
  <input type="checkbox" name="termsCondition" value="3" /> 3
  <input type="checkbox" name="termsCondition" value="4" /> 4
</body>
</html>

Output



Learn JavaScript and HTML

Get 100% success in IT certification exams with SPOTO dumps

If you want to get success and grow your IT carrier with various IT certification programs and don't know what type of questions are being asked in those certification exams and are not sure how to score 100 percent or score to success, then I am going to share one trick with you. Yes, it's SPOTO. 

Why Certification is important?

IT certification exams are very important to grow and boost your carrier in the market, and also make you SME or give confidence for that software and program. Certifications also help employees to make a good compensation in comparison with non-certified resources. Big IT companies always prefer to hire a certified resource in their respective domain.

Who can guide you in certification?

SPOTO is the world's best IT exam dump provider with a guaranteed 100 percent success rate. If you are going to attempt a certification (e.g. Cisco CCNA, CCNP, CCNP DevNet, CCDE, EI, CompTIA+, PMP, NPDP, ACP, Microsoft, Huawei, Redhat, Linux, Oracle, Aruba, F5, CWNA, and Palo Alto Certification practice exams) and you don't want to lose your certification fee with failure, then you should purchase a dump from SPOTO for your exam to get the exam clear. SPOTO has a large technical team of SMEs who are working day and night for you to give success in your carrier.

SPOTO is a specialist in Cisco Certification and provides the best, most reliable, and accurate study materials for your Cisco certification exams to practice, which helps you to score distinction marks and garb the certification to boost your IT carrier.

You can find and read more about SPOTO courses and programs here.

Cisco Certification

Cisco Certified Internetwork Expert (CCIE) Lab exam is the final stage of becoming a CCIE certified professional. There are very few professionals in the world who has this certification. The one who clears the exam is very high in demand in the market and gets a handsome salary beyond their expectation. You can easily crack the CCIE exam with the help of SPOTO CCIE Lab Dumps.

Top 10 free video editor software or tool for video creators or youtubers

Windows Movie Maker


VideoPad


Vimeo


Adobe Spark