Skip to content

Instantly share code, notes, and snippets.

@kzkn
Last active March 24, 2020 16:35
Show Gist options
  • Save kzkn/3157bfffd081a4043caf87437df82129 to your computer and use it in GitHub Desktop.
Save kzkn/3157bfffd081a4043caf87437df82129 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<!-- Include Choices CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/public/assets/styles/choices.min.css" />
<!-- Include Choices JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/public/assets/scripts/choices.min.js"></script>
</head>
<body>
<select disabled>
<option>one</option>
<option>two</option>
</select>
<button>
enable
</button>
<script>
let choices = new Choices(document.querySelector('select'))
document.querySelector('button').addEventListener('click', function() {
choices.enable() // this will make choices enable but not its options
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment