Updated HTML and Javascript in HTML

I'm using the most recent Version of Safar (9.0)


I'm using Xcode to edit some local JavaScript and HTML that is being viewed in Safari (Please let me know if there is a better way of doing what I'm describing, I'm all ears).

My problem is that when I make the changes to the Javascript in Xcode then save, even when reloading the HTML and associated Javascript files (both using the reload button in the address bar and the Reload [Ignoring Cache and Generic Options] on the Resources Panel, the changes to the underlying files do not become visible (even after the refreshes)


Even when I'm not running with breaks I have to do one of two things to get the changes to become visible

a) close out the page completley by closing the tab

b) under resources clicking the source file in question so the javascript pops up in a new tab, then clicking the refresh button on the Resources panel.


Is there an easier way to get the changes to become visible in Safari as soon as I save them in xCode?


Is there a better way to do this that involves either Only Safari or Only xCode thanks, Jeff

I recommend you try with this code to get both the link and text copied to clipboard and let me know the results

const onClick = evt => { let text = "Text to be converted to a link."; let url = "hola puede ir a https://google.com" + "\n\n" + "https://www.apple.com"; let element = document.getElementById("my-element");

element.innerHTML = `<a href="${url}">${text}</a>`; 
let varName = document.getElementById("links").value;

content.innerHTML = varName;
element.innerHTML = varName + url;
navigator.clipboard.writeText(element.innerHTML);
 
}
document.querySelector('#links').addEventListener('click', onClick);

Please try this and let me know

DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content=""> <meta name="description" content=""> </head> <body> <button id="link">!<a href="#">....</a>
</button> <textarea type="text" id="Pass" class="botonMapa" value=""></textarea> <div id="Template">
<div id="tarjetas" style="overflow-y: scroll; overflow-x:hidden; height:500px; float: center;">
<table id="tabla" class="tabla"> <tr class="buscador"> </tr> <tr class="head"> <th class="head" style="background-color: #2f3030; color: white; height: 30px; "> <input style="color: white; width: 400px;" type="text" id="tfBuscar" class="Buscador" placeholder="Buscar..." /> </th> </tr> <tr> <td class="tarjeta"><button class="art bdoton">HT202020</button><button class="boton"><a id="melement" value="hola" href="#" target="_blank">Google link</a>IOS 17 - Verificar Cx - Articulo <a id="melement" value="hola" href="#" target="_blank">YT</a></button> </td> </tr> <tr> <td class="tarjeta"><button value="apple..." id="apel" class="boton">Manzana<a id="myelement" href="#" target="_blank">A ple</a></button> </td> </tr> <tr class="resultados"> <th><span class="resultados"></span></th> </tr> </table> </div> </div> <script> const botones = document.querySelectorAll(".boton"); const cuandoSeHaceClick = function (evento) { let urrl = this.querySelector('a').href; const texto = this.querySelector('a').innerHTML; document.getElementById("link").innerHTML = <a href="${urrl}">${texto}</a>;

//const link = this.querySelector('a'); -only selector a-
const link = this;
const range = document.createRange();
range.selectNode(link);
const selection = window.getSelection();	
selection.removeAllRanges();
selection.addRange(range);
const successful = document.execCommand('copy');	
Pass.value = this.value;		
navigator.clipboard.write([clipboardItem]);
this.style.borderColor = "blue";		
} 
botones.forEach(boton => {
boton.addEventListener("click", cuandoSeHaceClick);
});  	
</script>     

</body> </html>

<!DOCTYPE html> <html> <head> <title>Cargar lista desde tabla</title> <style> .tabla { border-collapse: collapse; width: 100%; }
.tabla td { border: 1px solid #ddd; padding: 8px; }
.lista ul { list-style-type: none; /* Quitar viñetas / padding: 0; / Eliminar padding por defecto */ } .lista li { margin: 0; }
#output { display: none; } </style> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> <input type="file" id="csvFile" accept=".csv"> <div id="output"></div>

<!--table class="tabla"> <tr> <td>Item 1</td> </tr>
</table-->

<div class="lista"> <ul></ul> </div> <script> document.getElementById('csvFile').addEventListener('change', function(event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function(e) { const csvData = e.target.result; processCSV(csvData); }; reader.readAsText(file); } });

function processCSV(csv) { const lines = csv.split('\n'); let tableHTML = '<table id="tabla">'; for (const line of lines) { const values = line.split(','); tableHTML += '<tr>'; for (const value of values) { tableHTML += <td>${value}</td>; } tableHTML += '</tr>'; } tableHTML += '</table>'; document.getElementById('output').innerHTML = tableHTML;

const tabla = document.querySelector('#tabla');    
const lista = document.querySelector('.lista ul');
const rows = tabla.querySelectorAll('tr');
//var lv = document.getElementById("tabla").rows[0].cells[0].innerHTML;
//document.getElementById("ola").innerHTML = lv;
let html = "";
rows.forEach(row => {
  const cellText = row.querySelector('td').textContent.trim();
    if (cellText) {
      html += `<li>"" + ${cellText} + "ola"</li>`;
    }
});

if (html) {
  lista.innerHTML = html;
} else {
  lista.innerHTML = "<li>No hay datos en la tabla para mostrar</li>";
}    

} </script> </body> </html>

I suggest you try material design for buttons and menu, like this... <div class="input-container"> <input type="text" id="fname" name="fname" value="" aria-labelledby="label-fname" /> <label class="label" for="fname" id="label-fname"> <div class="text">First Name</div> </label> </div> .input-container { position: relative; }

input { height: 48px; width: 280px; border: 1px solid #c0c0c0; border-radius: 4px; box-sizing: border-box; padding: 16px; }

.label { position: absolute; top: 0; bottom: 0; left: 16px; display: flex; align-items: center; pointer-events: none; }

input, .label .text { font-family: 'Segoe UI'; font-size: 16px; }

.label .text { transition: all 0.15s ease-out; color: grey; }

input:focus { outline: none; border: 2px solid blue; }

input:focus + .label .text, :not(input[value=""]) + .label .text { font-size: 12px; transform: translate(0, -150%); background-color: white; padding-left: 4px; padding-right: 4px; }

input:focus + .label .text { color: blue; } const input = document.getElementById('fname');

input.addEventListener('input', () => { input.setAttribute('value', input.value); });

Btn1 <button class="pure-material-button-contained">Button</button>

.pure-material-button-contained { position: relative; display: inline-block; box-sizing: border-box; border: none; border-radius: 4px; padding: 0 16px; min-width: 64px; height: 36px; vertical-align: middle; text-align: center; text-overflow: ellipsis; text-transform: uppercase; color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255)); background-color: rgb(var(--pure-material-primary-rgb, 33, 150, 243)); box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12); font-family: var(--pure-material-font, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system); font-size: 14px; font-weight: 500; line-height: 36px; overflow: hidden; outline: none; cursor: pointer; transition: box-shadow 0.2s; }

.pure-material-button-contained::-moz-focus-inner { border: none; }

/* Overlay */ .pure-material-button-contained::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background-color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255)); opacity: 0; transition: opacity 0.2s; }

/* Ripple / .pure-material-button-contained::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; padding: 50%; width: 32px; / Safari / height: 32px; / Safari */ background-color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255)); opacity: 0; transform: translate(-50%, -50%) scale(1); transition: opacity 1s, transform 0.5s; } Hover, Focus */ .pure-material-button-contained:hover, .pure-material-button-contained:focus { box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12); }

.pure-material-button-contained:hover::before { opacity: 0.08; }

.pure-material-button-contained:focus::before { opacity: 0.24; } pure-material-button-contained:hover:focus::before { opacity: 0.3; }

/* Active */ .pure-material-button-contained:active { box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12); }

.pure-material-button-contained:active::after { opacity: 0.32; transform: translate(-50%, -50%) scale(0); transition: transform 0s; }

/* Disabled */ .pure-material-button-contained:disabled { color: rgba(var(--pure-material-onsurface-rgb, 0, 0, 0), 0.38); background-color: rgba(var(--pure-material-onsurface-rgb, 0, 0, 0), 0.12); box-shadow: none; cursor: initial; } pure-material-button-contained:disabled::before { opacity: 0; }

.pure-material-button-contained:disabled::after { opacity: 0; } Fond <body> <div id="cbar"> <div id="nvbar"> </div> </div>

</body>

  • { margin: 0 auto;

} h1{ color:green; }

h2{ color:RED; }

#cbar { width: 150%; height: 250px; background-color: rgb(67, 71, 97); position: absolute; z-index: -2; top: 0; }

#nvbar { height: 60px; width: auto; background-color: rgb(58, 58, 66); }

#content { width: 65%; height: 500px; z-index: 3; background-color: #ddd; margin-top: 80px; box-shadow: 1px 1px 1px 1px #ccc; } Nav <div class="nav-header"> <div class="nav-header__menu-show nav-button button-light material-icons" tabindex="0">menu</div> <div class="nav-header__left-align"> <span class="nav-header__title">Title</span> <span class="nav-header__title">&minus;</span> <span>Subtitle</span> </div> <div> <div class="nav-header__side-button nav-button button-light material-icons" tabindex="0">search</div> <div class="nav-header__side-button nav-button button-light material-icons" tabindex="0">more_vert</div> </div> </div>

  • { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; /* Chrome & Safari / -moz-user-select: none; / Firefox / -ms-user-select: none; / IE 10+ */ user-select: none;

}

html, body { margin: 0; padding: 0; cursor: default; }

:root { --theme-color: #263238; --accent-color: #ffffff; --theme-text: #FFF; background-color: #ffffff; color: #000; font-family: 'Roboto', sans-serif; }

.nav-header { --nav-button-padding: 7px; background-color: var(--theme-color, #333); color: var(--theme-text, #FFF); width: 100%; height: 64px; padding: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); font-size: 18px; position: fixed; display: flex; flex-direction: row; align-items: center; overflow: hidden; }

.nav-header__left-align { flex: 1; }

.nav-header__menu-show { margin-right: 12px; }

.nav-header__title { padding-right: 8px; }

.nav-header__side-button { margin-left: var(--nav-button-padding, 12px); }

.nav-button { padding: var(--nav-button-padding, 12px); height: 100%; }

@media screen and (max-width: 480px) { .nav-header__title { display: none; } }

.button-light:hover { background-color: rgba(22, 49, 77, 0.14); } .button-light:active, .button-light:focus { background-color: rgba(255, 255, 255, 0.14); }

.button-light:focus { outline: 1px solid #FFF; }

.button-dark:hover, .button-dark:active, .button-dark:focus { background-color: rgba(0, 0, 0, 0.07); } Upload <input id="upload" hidden type="file"/> <label for="upload" class="btn btn-primary" tabindex="0">Upload File</label>

body { padding: 10px; }

$(document).ready(onLoad);

function onLoad() { $('label').on('keydown', onKeyDown); }

function onKeyDown(e) { const enterKey = 13; const spaceKey = 32; if (e.keyCode === enterKey || e.keyCode === spaceKey) { $('#upload').click(); } }

I think it should work. A way to read the columns separately

<!DOCTYPE html> <html> <head> <title>Evento onmouseover</title> <style> /* Estilos CSS para el elemento */ .elemento { width: 200px; height: 100px; background-color: lightblue; border: 1px solid black; display: inline-block; padding: 10px; text-align: center; } .elemento:hover { background-color: lightgreen; cursor: pointer; }

.btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8; } .btn { display: inline-block; font-weight: 400; line-height: 1.25; text-align: center; white-space: nowrap; vertical-align: middle; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border: 1px solid transparent; padding: .5rem 1rem; font-size: 1rem; border-radius: .25rem; -webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out; }

label { display: inline-block; margin-bottom: .5rem; } //181b1d btn primary background-color: 37474F; .btn-primary.active, .btn-primary:active, .show>.btn-primary.dropdown-toggle { color: #fff; background-color: #025aa5; background-image: none; border-color: #01549b; } .btn-primary.focus, .btn-primary:focus { -webkit-box-shadow: ‪0 0 0 2‬px rgba(2, 117, 216, .5); box-shadow: ‪0 0 0 2‬px rgba(2, 117, 216, .5); } .btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b; } btn.active, .btn:active { background-image: none; } .btn.focus, .btn:focus { outline: 0; -webkit-box-shadow: ‪0 0 0 2‬px rgba(2, 117, 216, .25); box-shadow: ‪0 0 0 2‬px rgba(2, 117, 216, .25); } .btn:focus, .btn:hover { text-decoration: none; }

</style> </head> <body> <input id="upload" hidden type="file"/> <label for="upload" class="btn btn-primary" tabindex="0">Upload File</label> <div class="elemento" onmouseover="this.style.backgroundColor = 'lightgreen'; this.style.cursor = 'pointer';" onmouseout="this.style.backgroundColor = 'lightblue'; this.style.cursor = 'default';"> Haz click aquí </div>

<input type="file" id="csvFile" accept=".csv">

<div class="elemento"> Haz click aquí </div>

<div id="csv"> hola </div>

<input type="file" onchange=read(this)> <div class="output"></div>

<script> const button = document.createElement('button'); button.textContent = 'Click Me'; const link = document.createElement('a'); link.href = 'https://www.example.com'; link.appendChild(button); document.body.appendChild(link);

document.getElementById("csvFile").addEventListener("change", handleFile);

function handleFile(event) { const file = event.target.files[0]; if (!file) return;

 const reader = new FileReader();
 reader.onload = function(e) {
   const csvText = e.target.result;
   const lines = csvText.split('\n');
   const firstColumn = lines.map(line => line.split(',')[1]);
   console.log(firstColumn);
  document.getElementById("csv").innerHTML = firstColumn;
 };
 reader.readAsText(file);

}

const reader = new FileReader()

function read(input) { const csv = input.files[0] reader.readAsText(csv)

}

reader.onload = function (e) { document.querySelector('.output').innerText = e.target.result; }

</script>

</body> </html>

AnotherNaV

<div class="mdl-layout mdl-js-layout"> <header class="mdl-layout__header"> <div class="mdl-layout__header-row"> <span class="mdl-layout-title">Google</span> <div class="mdl-layout-spacer"></div> <nav class="mdl-navigation">                         <a class="mdl-navigation__link current" href="#">Home</a>                         <a class="mdl-navigation__link" href="#">About</a>                         <a class="mdl-navigation__link" href="#">Portfolio</a>                         <a class="mdl-navigation__link" href="#">Blog</a>                         <a class="mdl-navigation__link" href="#">Shop</a>                         <a class="mdl-navigation__link" href="#">Contact</a> </nav>                   <i id="search-button" class="material-icons search">search</i>                   <div class="mdl-tooltip" for="search-button">Search</div>                   <i id="shopping-button" class="material-icons cart">shopping_cart</i>                   <div class="mdl-tooltip" for="shopping-button"><div>                    <h3>helo</h3>                       </div></div> </div> </header>       <div class="mdl-layout__drawer"> <span class="mdl-layout-title">Google</span>             <span class="mdl-layout-sub-title">Sidebar menu</span> <nav class="mdl-navigation"> <a class="mdl-navigation__link" href="#">Products</a> <a class="mdl-navigation__link" href="#">Services</a> <a class="mdl-navigation__link" href="#">Portfolios</a> <a class="mdl-navigation__link" href="#">Achievements</a> <a class="mdl-navigation__link" href="#">Blog</a> </nav> </div> </div> </div>

.mdl-layout-sub-title{       padding-left:40px;       font-weight: bold; }

/* HEADER */ header.mdl-layout__header{       background: #232f34;       color: #fff; } .mdl-layout__header-row .mdl-navigation__link{       opacity: 0.75;       transition-duration: 0.3s; } .mdl-layout__header-row .mdl-navigation__link:hover{       opacity: 1;       transition-duration: 0.3s; } .mdl-layout__header-row .mdl-navigation__link.current{       opacity: 1;       font-weight: bold; } .mdl-layout__header-row .mdl-navigation__link, .mdl-layout__drawer-button{       color: gray; } i.search{       margin-left: 24px;             cursor: pointer; } i.cart{       margin-left: 24px;        cursor: pointer;        font-size: 20px} .mdl-layout__drawer nav {       border-bottom:1px solid #ddd;        }

To include a link inside the button or div just use this code const div = document.getElementById('miDiv'); const url = 'https://www.ejemplo.com';

// Metodo 1: Usando innerHTML // div.innerHTML += <a href="${url}">Enlace a ejemplo.com</a>;

// Metodo 2: Creando el elemento a

 let myButton = document.createElement('button');
myButton.textContent = 'Click Me';
document.body.appendChild(myButton);

const a = document.createElement('a'); a.href = url; a.textContent = 'Enlace a ejemplo.com'; myButton.appendChild(a);

Try this $ tr ';' ',' < /ruta/puntocoma.csv > /ruta/coma.csv sed 's/,/;/g' archivo.csv > archivo nuevo.csv.

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body {font-family: Arial, Helvetica, sans-serif;}

/* The Modal (background) / .modal { display: none; / Hidden by default / position: fixed; / Stay in place / z-index: 1; / Sit on top / left: 0; top: 0; width: 100%; / Full width / height: 100%; / Full height / overflow: auto; / Enable scroll if needed / background-color: rgb(0,0,0); / Fallback color / background-color: rgba(0,0,0,0.4); / Black w/ opacity / -webkit-animation-name: fadeIn; / Fade in the background */ -webkit-animation-duration: 0.4s; animation-name: fadeIn; animation-duration: 0.4s }

/* Modal Content */ .modal-content { position: fixed; margin: 10px 12px; top: 0; background-color: #fefefe; width: 98%; -webkit-animation-name: slideIn; -webkit-animation-duration: 0.4s; animation-name: slideIn; animation-duration: 0.4s }

/* The Close Button */ .close { color: rgb(182, 182, 182); float: right; font-size: 50px; font-weight: bold; }

.close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; }

.modal-header { margin: 10px;
padding: 2px 12px; background-color: #021d46; color: white; }

.modal-body {padding: 2px 16px;}

.modal-footer { margin: 10px; padding: 2px 16px; background-color: #021d46; color: white; }

/* Add Animation */ @-webkit-keyframes slideIn { from {bottom: -300px; opacity: 0} to {bottom: 0; opacity: 1} }

@keyframes slideIn { from {bottom: -300px; opacity: 0} to {bottom: 0; opacity: 1} }

@-webkit-keyframes fadeIn { from {opacity: 0} to {opacity: 1} }

@keyframes fadeIn { from {opacity: 0} to {opacity: 1} } </style> </head> <body>

<h2>Bottom Modal</h2>

<!-- Trigger/Open The Modal --> <button id="myBtn">Open Modal</button>

<!-- The Modal --> <div id="myModal" class="modal">

<!-- Modal content --> <div class="modal-content"> <div class="modal-header" style="text-align: center;">
<h2>Modal Header</h2> </div> <div class="modal-body"> <p>Some text in the Modal Body</p> <p>Some Lorem Ipsum.</p> </div> <div class="modal-footer"><span class="close">&times;</span> <h3>Modal Footer</h3> </div> </div>

</div>

<script> // Get the modal var modal = document.getElementById("myModal");

// Get the button that opens the modal var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0];

// When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; }

// When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script>

</body> </html>

Ok try this I let me know how it goes

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .modal { display: none; /* Hidden by default / position: fixed; / Stay in place / z-index: 1; / Sit on top / left: 0; top: 0; width: 100%; / Full width / height: 100%; / Full height / overflow: auto; / Enable scroll if needed / background-color: rgba(0,0,0,0.4); / Black w/ opacity */ }

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px; /* Optional: max width */
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

</style> </head> <body>

<button id="openModalBtn">Open Modal</button> <button id="openModalBtn2">Open Modal2</button> <button id="openModalBtn3">Open Modal3</button> <div id="myModal" class="modal"> <div class="modal-content"> <span class="close-button">&times;</span> <h2>Modal Title</h2> <p id="txt">This is the content of the modal window.</p> </div> </div>

<script>
const txt = document.getElementById("txt");
const modal = document.getElementById("myModal");
const openBtn = document.getElementById("openModalBtn");
    const openBtn2 = document.getElementById("openModalBtn2");
        const openBtn3 = document.getElementById("openModalBtn3");
     

const closeBtn = document.querySelector(".close-button");

openBtn.onclick = function() {
    modal.style.display = "block";
    txt.innerHTML = openBtn.innerHTML;        
   
}
openBtn2.onclick = function() {
    modal.style.display = "block";
    txt.innerHTML = openBtn2.innerHTML;
}
    openBtn3.onclick = function() {
    modal.style.display = "block";
   
    txt.innerHTML = openBtn3.innerHTML;
}
closeBtn.onclick = function() {
    modal.style.display = "none";
}

window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}

</script>

</body>
</html>

≠=========)

<button id="textToCopy">Text to Copy <a href="https://support.apple.com/en-us/118107">ola</a></button> <button id="copyButton">Click Me!</button> <!--div id="textToCopy">This is the text to be copied.</div> <button id="copyButton">Copy Text</button>

    <button id="buttonToCopy">Content to Copy</button>

<button id="anotherButton">Click Me</button-->

<script> document.addEventListener('DOMContentLoaded', () => { const textElement = document.getElementById('textToCopy'); const copyButton = document.getElementById('copyButton');

    copyButton.addEventListener('click', async () => {
        const text = textElement.innerText; // Or .value for input/textarea
        try {

const range = document.createRange(); range.selectNode(textElement); const selection = window.getSelection();
selection.removeAllRanges(); selection.addRange(range); const successful = document.execCommand('copy');

            console.log('Text copied to clipboard!');
            // Optional: Provide visual feedback to the user (e.g., change button text)
            copyButton.textContent = 'Copied!';
            setTimeout(() => {
                copyButton.textContent = 'Copy Text';
            }, 2000); // Reset button text after 2 seconds
        } catch (err) {
            console.error('Failed to copy text: ', err);
            // Optional: Handle errors, e.g., show an alert
            alert('Failed to copy text. Please try again or copy manually.');
        }
    });
});

</script>

<a class="button">Click Me</a>

.button{ position: relative; background-color: black; border-radius: 4em; font-size: 16px; color: white; padding: 0.8em 1.8em; cursor:pointer; user-select:none; text-align: center; text-decoration: none; cursor: pointer; transition-duration: 0.4s; -webkit-transition-duration: 0.4s; /* Safari */ } button:hover { transition-duration: 0.1s; background-color: #3A3A3A; }

.button:after { content: ""; display: block; position: absolute; border-radius: 4em; left: 0; top:0; width: 100%; height: 100%; opacity: 0; transition: all 0.5s; box-shadow: 0 0 10px 40px white; }

.button:active:after { box-shadow: ‪0 0 0 0‬ white; position: absolute; border-radius: 4em; left: 0; top:0; opacity: 1; transition: 0s; }

.button:active { top: 1px; }

.button { text-align: center; text-transform: uppercase; cursor: pointer; font-size: 20px; letter-spacing: 4px; position: relative; background-color: #16a085; border: none; color: #fff; padding: 20px; width: 200px; text-align: center; transition-duration: 0.4s; overflow: hidden; box-shadow: 0 5px 15px #193047; border-radius: 4px; }

.button:hover { background: #fff; box-shadow: 0px 2px 10px 5px #1abc9c; color: #000; }

.button:after { content: ""; background: #1abc9c; display: block; position: absolute; padding-top: 300%; padding-left: 350%; margin-left: -20px !important; margin-top: -120%; opacity: 0; transition: all 0.8s }

.button:active:after { padding: 0; margin: 0; opacity: 1; transition: 0s }

.button:focus { outline:0; }

<div class="clk"><a href="javascript:void"><i class="fa fa-plus-circle"></i>some text</a><div>

body{ background: #d4ffe4;                          height: 100vh;                          display: flex;                          justify-content: center;                          align-items: center;                         
} i{ color:red; }

$('.clk a').click(function(){ $(this).find('i').toggleClass('fa-plus-circle fa-minus-circle') });

<span id="color2">𝄞</span></p> document.getElementById("color2").style.color = "blue";

Updated HTML and Javascript in HTML
 
 
Q