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

interlinker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interlinker

Links mulitiple inputs togheter

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Interlinker

Enables or disables checkboxes, input, etc. (or adds a class) depending on the state of other checkboxes or other inputs (by id).

Inputs other than checkboxes and radio buttons are "checked" if they are valid.

Initialize

<script src="interlinker.js"></script>
<script>Interlinker.index()</script>

Examples

(they aren't necessarily good examples and only illustrate the concept)

<!-- simple dependecy -->
<input type="checkbox" id="cake" /> I'd like cake
<input type="checkbox" id="candles" depends="cake" /> I'd like it with candles

<!-- multi dependecy -->
<input type="checkbox" id="sign" depends="[cake,candles]">I'd like it with a sign

<!-- inverted dependecy -->
<input type="checkbox" id="ice_cream" depends="!cake" />I'd like ice cream

If you add depends on anything else than inputs the class disabled` will be applied to it

<input type="checkbox" id="cake" /> I'd like cake
<img src="cake.png" id="cake" />

<style>
img.disabled { display: none }
</style>

FAQs

Package last updated on 17 Jun 2019

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