New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tag

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tag

Library for creating DOM elements

latest
Source
npmnpm
Version
0.4.17
Version published
Weekly downloads
197
12.57%
Maintainers
1
Weekly downloads
 
Created
Source

tag

GitHub license npm version npm downloads Build Status npm bundle size (minified) npm bundle size (minified + gzip)

Installation

npm install tag --save

or

<script src="tag.iife.js"></script>

tag(name, *attributes, children)

  • Parameters
    • name: String
    • attributes: Object (optional)
    • children: Array | String
  • Returns - HTMLElement

Example

import tag from 'tag';

tag('div', { id: 'content' }, 'content');

tag('div', { id: 'content' }, [tag('span', 'content')]);

tag('div', [tag('span', '<strong>content</strong>')]);

tag('hr');

tag('label', [tag('input', { type: 'text' }), 'Label text']);

This software is released under the terms of the MIT license.

Keywords

dom

FAQs

Package last updated on 02 Dec 2020

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