### Copying NPM Install Command on Click (JavaScript) Source: https://github.com/kutlugsahin/reactive/blob/main/packages/landing/index.html This JavaScript snippet adds a click event listener to an HTML element with the ID 'npm-cmd'. When clicked, it uses the browser's Clipboard API to copy the string 'npm i @re-active/react' to the user's clipboard. ```javascript document.getElementById('npm-cmd').addEventListener('click', () => { navigator.clipboard.writeText('npm i @re-active/react'); }); ``` -------------------------------- ### Injecting Microsoft Clarity Script (JavaScript) Source: https://github.com/kutlugsahin/reactive/blob/main/packages/landing/index.html This standard JavaScript snippet is used to asynchronously load and initialize the Microsoft Clarity tracking script on the webpage for user behavior analytics. It creates a script element, sets its source, and inserts it into the document head. ```javascript (function (c, l, a, r, i, t, y) { c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments); }; t = l.createElement(r); t.async = 1; t.src = 'https://www.clarity.ms/tag/' + i; y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y); })(window, document, 'clarity', 'script', 'i0qevbmhvh'); ``` -------------------------------- ### Initialize Microsoft Clarity Tracking - JavaScript Source: https://github.com/kutlugsahin/reactive/blob/main/packages/sandbox/index.html This snippet is a standard script provided by Microsoft Clarity to add tracking to a web page. It uses an immediately invoked function expression (IIFE) to create and insert a script element pointing to the Clarity tag URL into the document. It also sets up the 'clarity' function on the window object for pushing commands. ```JavaScript (function (c, l, a, r, i, t, y) { c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments); }; t = l.createElement(r); t.async = 1; t.src = 'https://www.clarity.ms/tag/' + i; y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y); })(window, document, 'clarity', 'script', 'i0qg9atdz4'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.