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

html4-id

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

html4-id

Create a valid HTML4 ID from an input value.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

html4-id

npm Downloads Node.js Version Build Status Coverage Status bitHound Dependencies bitHound Dev Dependencies bitHound Code

Create a valid HTML4 ID from an input value.

Install

NPM
$ npm install html4-id

Node.js

var idify = require('html4-id');

idify('This is a test!'); // Returns "this-is-a-test"

Browser

<script src="node_modules/html4-id/dist/html4-id.min.js"></script>

<div id="{{idify('This is a test!'}}"></div> <!-- Has the ID "this-is-a-test" -->

idify(string)

Removes invalid characters and generates an id meant to be used for HTML elements. See MDN for the note about invalid characters.

License

MIT

Keywords

FAQs

Package last updated on 14 Sep 2016

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