Tạo nhóm button radio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Radio Button Groups</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="m-4">
<div class="btn-group">
<input type="radio" class="btn-check" name="options" id="radio1" autocomplete="off">
<label class="btn btn-outline-primary" for="radio1">Radio 1</label>
<input type="radio" class="btn-check" name="options" id="radio2" autocomplete="off" checked>
<label class="btn btn-outline-primary" for="radio2">Radio 2</label>
<input type="radio" class="btn-check" name="options" id="radio3" autocomplete="off">
<label class="btn btn-outline-primary" for="radio3">Radio 3</label>
</div>
</div>
</body>
</html>
Thấy bài viết hữu ích?
Ủng hộ tác giả để có thêm nhiều bài viết chất lượng nhé!