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

snabbdom

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snabbdom - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

modules/attributes.js

2

package.json
{
"name": "snabbdom",
"version": "0.2.5",
"version": "0.2.6",
"description": "A virtual DOM library with focus on simplicity, modularity, powerful features and performance.",

@@ -5,0 +5,0 @@ "main": "snabbdom.js",

@@ -202,2 +202,22 @@ # Snabbdom

### The attributes module
Same as props but set attributes instead of properties on DOM elements
```javascript
h('a', { attrs: {href: '/foo'} }, 'Go to Foo');
```
Attributes are added and updated using `setAttribute`. In case of an attribute
that has been previously added/set is no longer present in the `attrs` object,
it is removed from the DOM element's attribute list using `removeAttribute`.
In the case of boolean attributes (.e.g. `disabled`, `hidden`, `selected` ...).
The meaning doesn't depend on the attribute value (`true` or `false`) but depends
instead on the presence/absence of the attribute itself in the DOM element. Those
attributes are handled differently by the module : if a boolean attribute is set
to a [falsy value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) (`0`, `-0`, `null`, `false`,`NaN`, `undefined`, or the empty
string (`""`)) then the attribute will be removed from the attribute list of the
DOM element.
### The style module

@@ -204,0 +224,0 @@

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