npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ssd-select

v2.1.1

Published

jQuery plugin to handle most common events associated with the form 'select' tag.

Readme

SSD Select

jQuery plugin to handle most common events associated with the form 'select' tag.

See demo

Installation

You can install this plugin via npm:

npm install ssd-select

Usage instructions

First include all resources and call the plugin

<script src="./node_modules/jquery/dist/jquery.min.js"></script>
<script src="./node_modules/ssd-select/src/jquery.ssd-select.min.js"></script>

Instantiating the plugin

To instantiate the plugin you have two options. You strictly specify what action you want to bind to a given element

<script>
    $('[data-ssd-select]').ssdSelect({
        action : 'call-redirect'
    });
</script>

or you can tell it to dynamically obtain it from a specific attribute of that element (default is data-ssd-select)

<script>
    $('[data-ssd-select]').ssdSelect({
        action_attribute : 'data-ssd-select'
    });
</script>

Additionally, you need to provide the name of the css class that will hide elements from the view (default is dn)

<script>
    $('[data-ssd-select]').ssdSelect({
        hide_class : 'dn'
    });
</script>

If the value is store in a different attribute then the default value, you can use the value_attribute property.

<script>
    $('[data-ssd-select]').ssdSelect({
        value_attribute : 'data-value'
    });
</script>
  • The action allows you to specify a single action to be used on the select object.
  • The action_attribute represents the attribute that will store the type of the action required for a given select object.
  • The hide_class is used to specify the class name that has display set to none as it will be used to show and hide certain elements.
  • The value_attribute allows you to specify which attribute of the option tag should be used instead of a default value
.dn {
    display: none;
}

Available actions

You're now ready to apply it to your select elements

Make ajax call and redirect call-redirect

<select data-ssd-select="call-redirect">
    <option value="/">Select one</option>
    <option value="./calls/redirect.json">First</option>
    <option value="./calls/redirect.json">Second</option>
</select>

Ajax call should return the response in the following format:

{
  "redirect": "http://ssdtutorials.com"
}

Make ajax call and reload the page call-reload

<select data-ssd-select="call-reload">
    <option value="/">Select one</option>
    <option value="./calls/reload.json">First</option>
    <option value="./calls/reload.json">Second</option>
</select>

No response needed for this call.

Make ajax call and replace content call-replace

<select data-ssd-select="call-replace">
    <option value="/">Select one</option>
    <option value="./calls/replace.json">Replace</option>
</select>

<div class="first-replacement">First</div>
<div class="second-replacement">Second</div>

Ajax call should return the response in the following format:

{
  "replace": {
    ".first-replacement": "First replacement",
    ".second-replacement": "Second replacement"
  }
}

Make ajax call and replace elements call-replace-with

Ajax call should return the response in the following format:

{
  "replace": {
    ".first-replacement-with": "<p>First replacement with</p>",
    ".second-replacement-with": "<p>Second replacement with</p>"
  }
}

Make ajax call and perform action returned with the response call-action

<select data-ssd-select="call-action">
    <option value="/">Select one</option>
    <option value="./calls/action-redirect.json">Redirect</option>
    <option value="./calls/action-reload.json">Reload</option>
    <option value="./calls/action-replace.json">Replace</option>
    <option value="./calls/action-replace-with.json">Replace with</option>
</select>

<div class="action-first-replacement">First</div>
<div class="action-second-replacement">Second</div>

<div class="action-third-replacement-with">Third</div>
<div class="action-fourth-replacement-with">Fourth</div>

Ajax call should return the response as it would for any of the relevant actions plus the index action to indicate the desired action i.e.

{
  "action": "redirect",
  "redirect": "http://ssdtutorials.com"
}

Navigate to go-to

<select data-ssd-select="go-to">
    <option value="/">Select one</option>
    <option value="./calls/go-to-1.html">First</option>
    <option value="./calls/go-to-2.html">Second</option>
</select>

Show selected and hide others show-hide

<select data-ssd-select="show-hide">
    <option value="/">Select one</option>
    <option value="#" data-target=".first">First</option>
    <option value="#" data-target=".second">Second</option>
    <option value="#" data-target=".third">Third</option>
</select>

<div class="first">First</div>
<div class="second dn">Second</div>
<div class="third dn">Third</div>