ボタンのクリック後に href 属性を取得しようとしていますが、機能させることができません。
私のコード:
    <!-- Target -->
    <a href='https://clipboardjs.com/' id='foo'/>
 <!-- Trigger -->  
<button class='btn' data-clipboard-target='#foo'>
    Copy to clipboard
</button>  
<script type="text/javascript">
        new Clipboard(".btn", {
          text: function(trigger) {
            return $(trigger).getAttribute("href");
          }
        });
</script>
何か案は?
ありがとうございました