connector-wordpress/source/front/html-creator.js

8 lines
204 B
JavaScript
Raw Normal View History

2021-05-03 21:39:23 +02:00
export function createAnchorElement({ document, text, url }) {
2021-01-08 14:08:40 +01:00
const a = document.createElement('a')
a.setAttribute('href', url)
a.setAttribute('target', '_blank')
a.innerHTML = text
return a
}