The code I have below does the copy and flashes a brief confirmation message. I need it to instead add a character X in front of existing contents of that web page element:
<< ? - if you don't know just walk on by, if you need clarification - ask
javascript:(function() {
var copyText = document.getElementById("mergeFields-input-text");
copyText.select();
document.execCommand("Copy");
tempAlert("COPIED SUBJECT", 500);
function tempAlert(msg, duration) {
var el = document.createElement("div");
el.setAttribute("style","position:absolute;top:1%;left:35%;background-color:white;");
el.innerHTML = msg;
document.body.appendChild(el);
setTimeout(function(){
el.parentNode.removeChild(el);
}, duration
);
}
})();
11.1.18 Version
javascript:(function() {
var copyText = document.getElementById("mergeFields-input-text");
copyText.innerHTML = "-" + copyText.innerHTML();
tempAlert("ADDED", 500);
function tempAlert(msg, duration) {
var el = document.createElement("div");
el.setAttribute("style","position:absolute;top:1%;left:35%;background-color:white;");
el.innerHTML = msg;
document.body.appendChild(el);
setTimeout(function(){
el.parentNode.removeChild(el);
}, duration
);
}
})();
11.1.18 V2
javascript:(function() {
var copyText = document.getElementById("mergeFields-input-text");
copyText.value = "-" + copyText.value();
tempAlert("ADDED", 500);
function tempAlert(msg, duration) {
var el = document.createElement("div");
el.setAttribute("style","position:absolute;top:1%;left:35%;background-color:white;");
el.innerHTML = msg;
document.body.appendChild(el);
setTimeout(function(){
el.parentNode.removeChild(el);
}, duration
);
}
})();