Having some difficulty with the following Javascript code. I'm not very skilled in writing Javascript, so any assistance on adjusting it to replace any
with a regular space would be greatly appreciated.
Thank you
function copyToClipboard(element) {
var text = $(element).clone().find('script').remove().end().find('br').prepend('\n').end().text()
element = $('<textarea>').appendTo('body').val(text).select()
document.execCommand('copy')
element.remove()
}