.steps li
, and clicking on .steps li:before
?<!--- Script clicking on the items listed plus copies the link ID ---->
the <script>let buttons = document.querySelectorAll('.steps li, .i2 h2, .i2 h1');
Array.prototype.forEach.call(buttons, function(el) {
el.addEventListener("click", function(event) {
let tmp = document.createElement('INPUT');
let str = location.protocol + '//' + location.hostname + location.pathname + location.search +'#'+ el.id;
tmp.value = str;
document.body.appendChild(tmp);
tmp.select();
document.execCommand('copy');
document.body.removeChild(tmp);
});
});
</script>
.steps li { pointer-events: none; }
.steps li:before { pointer-events: all; }
Find more questions by tags jQueryJavaScript
Here's an example:
https://jsfiddle.net/fqhk7dea/ - ryann_Stehr commented on June 10th 19 at 15:25