Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

click and copy jquery dynamic content

Works great with Dynamically created list. Reading in from a database.

<style type="text/css">
.fw-code-copy {
  display: block;
  position: relative;
  width: 400px;
  height: 30px;
  background: #FFE;
  border: thin solid #FF0;
  margin-bottom: 0.5em;
  padding: 0.5em;
}
.fw-code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.25em;
  border: thin solid #777;
  background: #800080;
  color: #FFF;
}
.fw-code-copy-button:hover {
  border: thin solid #DDD;
  background: #992699;
  cursor: pointer;
}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.3/clipboard.min.js"></script>

<span class="fw-code-copy">
  <span class="fw-code-copy-button">Copy</span>
  <code>&lt;link rel=&quot;stylesheet&quot; href=&quot;style-1.css&quot;&gt;</code>
</span>
<span class="fw-code-copy">
  <span class="fw-code-copy-button">Copy</span>
  <code>&lt;link rel=&quot;stylesheet&quot; href=&quot;style-2.css&quot;&gt;</code>
</span>
<span class="fw-code-copy">
  <span class="fw-code-copy-button">Copy</span>
  <code>&lt;link rel=&quot;stylesheet&quot; href=&quot;style-3.css&quot;&gt;</code>
</span>

<script>
new Clipboard(".fw-code-copy-button", {
  text: function(trigger) {
    return $(trigger).parent().find('code').first().text().trim();
  }
});
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: print("Google") in JavaScript 
Javascript :: array con tridimensional javascript 
Javascript :: ejecutar una funcion js con id html usando jquery 
Javascript :: fse moveSync vs copySync 
Javascript :: agregar año en javascript 
Javascript :: js remove plus 
Javascript :: faher js 
Javascript :: js unwrap element 
Javascript :: ngx-countdown npm 
Javascript :: how to add some thing to url by js 
Javascript :: enum mongoose doesnt trigger error 
Javascript :: svlete each index 
Javascript :: material ui notify 
Javascript :: database number counter animation javascript from database 
Javascript :: number++ * 5 
Javascript :: textfield label language react 
Javascript :: convert python to js online 
Javascript :: jquery listen for click on class that was created later 
Javascript :: json volley dependency 
Javascript :: newline in javascript 
Javascript :: 4.6.3. Order of Operations¶ 
Javascript :: express orm 
Javascript :: 1update normalize-url 
Javascript :: knex update and fetch result mysql 
Javascript :: lity popup 
Javascript :: AngularJS module can be created using ............ A. module.create(); B.angular.create(); C.angular.module(); D.var myModule = new module(); 
Javascript :: how to get selected option attribute value in jquery 
Javascript :: absolute sum javascript 
Javascript :: global keyboard shortcuts react 
Javascript :: Calling JSON REST Services with FoxPro and wwJsonServiceClient 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =