Allows HTML elements to be passed in the constructor - Fixes #25

This commit is contained in:
Zeno Rocha 2015-10-26 23:00:13 -07:00
parent 94c3e5cf44
commit 861fcb53fd

View File

@ -51,11 +51,11 @@ allowtransparency="true" frameborder="0" scrolling="0" width="156" height="30"><
<h1 id="setup">Setup</h1>
<p>First, include the script located on the <code>dist</code> folder or load it from a <a href="https://github.com/zenorocha/clipboard.js/wiki/CDN">third-party CDN provider</a>.</p>
<p>First, include the script located on the <code>dist</code> folder or load it from <a href="https://github.com/zenorocha/clipboard.js/wiki/CDN-Providers">a third-party CDN provider</a>.</p>
<pre class="snippet"><code class="html">&lt;script src="dist/clipboard.min.js"&gt;&lt;/script&gt;</code></pre>
<p>Now, you need to instantiate it using a DOM selector. This selector corresponds to the trigger element(s), for example <code>&lt;button class="btn"&gt;</code>.</p>
<p>Now, you need to instantiate it by <a href="https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-selector.html#L18">passing a DOM selector</a>, <a href="https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-node.html#L16-L17">HTML element</a>, or <a href="https://github.com/zenorocha/clipboard.js/blob/master/demo/constructor-nodelist.html#L18-L19">list of HTML elements</a>.</p>
<pre class="snippet"><code class="js">new Clipboard('.btn');</code></pre>