Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-select-hd

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-select-hd

[![NPM](https://nodei.co/npm/js-select-hd.png?downloads=true)](https://nodei.co/npm/js-select-hd/)

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

js-select npm Build Status Coverage Status

NPM

The select library uses pure js for everyone. View demo here

Features

  • Super fast
  • Easy to use

Install

Install with javascript

<script src="dist/jsselect.js"></script>

Install with npm

npm install --save js-select-hd

Usage

Js Render

<script src="dist/jsselect.js"></script>
<script>
    const jsselect = new JSSelect('#js-select', [
    {id: 1, name: 'Độ tuổi'},
    {id: 2, name: 'Theo nhóm xe'},
    {id: 3, name: 'Giới tính'},
    {id: 4, name: 'Xe không có thuê bao'},
    {id: 5, name: 'Tiêu chí xe'},
    {id: 6, name: 'Tiêu chí xe 1'},
    {id: 7, name: 'Tiêu chí xe 2'},
    ], {
    placeholder: 'Chọn tiêu chí lọc',
    typing: 'Tìm kiếm tiêu chí lọc...',
    search: false, // Can select null value
    canNull: false, // Can select null value
    maxRow: 5 // Max value show
});

    jsselect.onSelected((item) => {
    console.log('Selected:', item);
    console.log('Selected ID:', jsselect.value);
})
</script>

Html Render

<select style="width: 325px;" class="js-select" name="select-x"
        data-jsSelect="true"
        data-placeholder="Chọn tiêu chí lọc"
        data-search="true"
        data-canNull="true"
        data-maxRow="6"
        data-typing="Tìm kiếm tiêu chí lọc...">
    <option value="1">Độ tuổi</option>
    <option value="2">Theo nhóm xe</option>
    <option value="3">Giới tính</option>
    <option value="4">Xe không có thuê bao</option>
    <option selected value="5">Tiêu chí xe</option>
    <option value="6">Tiêu chí xe 1</option>
    <option value="7">Tiêu chí xe 2</option>
</select>
<script src="dist/jsselect.js"></script>

Constructors

JSSelect(textDom, arrayData, options)

options.placeholder

Type: String
Default: ""

options.typing

Type: String
Default: ""

Events

onSelected(callback)

Method

setValue(value)

Contributing

See the CONTRIBUTING Guidelines

License

MIT © HoangDaiCntt

FAQs

Package last updated on 01 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc