JSFiddle - React, Tailwind, and code Playground

by Alexandru Gatea

HTML

<div class="element">
  
  <span class="special-price">

    
    <span data-atribute="custom">%</span>
    
  </span>
  
</div>

<button>Clone</button>

<div class="output">
  
</div>

JavaScript

jQuery(document).ready(function($) {

$('.special-price').prepend("45");

   $('button').on('click', function() {
  
    $('.output').html($('.special-price').html());
    
    alert($('.special-price').html());
  
  }); 
});