-2

I am new to jQuery, I want to add popover on button success of copy of text in div. For copy I am using clipboard.js and my code is mentioned below

Here is my code

enter image description here

Zeno Rocha
  • 3,226
  • 1
  • 23
  • 27
Saurabh
  • 35
  • 8

1 Answers1

1

I think you just need to add this :

showTooltip(e.trigger, 'Copied!');

Hope this helps !

Update

Code above is from clipboard.js. You don't need to load extra libraries, you can pop everything you want on success. For example you can add :

clipboard.on('success', function(e) {
    console.log(e);
    alert('Copied!');
});

If you use Bootstrap or another framework you can do easily what you want !

http://getbootstrap.com/javascript/#popovers

samfrend
  • 29
  • 4
  • Thanx for reply sam ..... I tried like this clipboard.on('success', function(e) { console.log(e); showTooltip(e.trigger, 'Copied!'); }); but its not working ....Do i need to import somthing..? – Saurabh Mar 15 '16 at 10:11