javascript Translate html links into text and keep the url as text -
ok have been looking around not found want. javascript function ideally transalate tag this
<a href="https://www.outlook-apps.com/blog/"> tips & tricks – outlook tools & utilities</a> tips & tricks – outlook tools & utilities https://www.outlook-apps.com/blog/ is there library available out there?
here is:
const = document.queryselector('a'); const src = a.href; const sentence = a.textcontent; const parent = a.parentelement; const text = document.createtextnode(`${sentence} ${src}`); window.settimeout(() => { parent.insertbefore(text, a); parent.removechild(a); }, 2000); <a href="https://www.outlook-apps.com/blog/"> tips & tricks – outlook tools & utilities</a> legacy
function makeastext(selector) { var = document.queryselector(selector); var src = a.href; var sentence = a.textcontent; var parent = a.parentelement; var text = document.createtextnode( sentence + '\n' + src ); parent.insertbefore(text, a); parent.removechild(a); } makeastext('a'); <a href="https://www.outlook-apps.com/blog/"> tips & tricks – outlook tools & utilities</a>
Comments
Post a Comment