]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Use pull request #11545 from ncoden/docs/javascript-plugin-instanciation-element...
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 21 Oct 2018 14:36:19 +0000 (16:36 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 21 Oct 2018 14:36:19 +0000 (16:36 +0200)
3a079659e docs: fix plugins instantiation examples in Javascript docs

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
docs/pages/javascript.md

index dee81d779bc0d5f3efba34fa6efbefff78ef0814..07229ef6b0866f96d803d86273e86fed56682dc6 100644 (file)
@@ -44,23 +44,23 @@ By default, Foundation is exported as [UMD modules](http://bob.yexley.net/umd-ja
 For example with [ES6](https://github.com/lukehoban/es6features#readme) (the ESM format):
 ```js
 import Foundation from 'foundation-sites';
-const $dropdown = new Foundation.Dropdown('#mydropdown');
+const $dropdown = new Foundation.Dropdown($('#mydropdown'));
 // Or
 import { Dropdown } from 'foundation-sites';
-const $dropdown = new Dropdown('#mydropdown');
+const $dropdown = new Dropdown($('#mydropdown'));
 ```
 
 With [RequireJs](http://requirejs.org/) (the AMD format):
 ```js
 define(['foundation'], function(Foundation) {
-  var $dropdown = new Foundation.Dropdown('#mydropdown');
+  var $dropdown = new Foundation.Dropdown($('#mydropdown'));
 });
 ```
 
 With [Node.js](https://www.safaribooksonline.com/library/view/learning-javascript-design/9781449334840/ch11s03.html) (the CommonJs format):
 ```js
 var Foundation = require('foundation-sites');
-var $dropdown = new Dropdown('#mydropdown');
+var $dropdown = new Dropdown($('#mydropdown'));
 ```
 
 #### Available formats