1.0.3 • Published 9 years ago
ct-select-box v1.0.3
select-box
In order for this plugin to work in older browsers, includ webcomponents.js plugin https://github.com/webcomponents/webcomponentsjs
How to use it
1. Include css file in header of the page
<link rel="stylesheet" href="build/ct-select-box.min.css">2. Include js file in footer of the page
<script src="build/ct-select-box.min.js"></script>3. Using in html
<select-box placeholder="Please select">
<select-box-header></select-box-header>
<select-box-content>
<select-box-option value="1"> 1 - option </select-box-option>
<select-box-option value="2"> 2 - option </select-box-option>
<select-box-option value="3"> 3 - option </select-box-option>
<select-box-option value="4"> 4 - option </select-box-option>
<select-box-option value="5"> 5 - option </select-box-option>
</select-box-content>
</select-box>Methods
reset()- Clearing of the selected optionsetOption(text, value)- Sets custom option by parametersisValid()- It checks whether option is selected
Properties
value- getting selected valuetext- getting selected option text
Attributes
placeholder- Sets default text-not requiredname- must be unique in one page-not required