1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-02-17 20:21:05 +01:00
connector-wordpress/source/front/html-creator.js

15 lines
387 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
}
2024-08-04 18:31:29 +02:00
export function createImageElement({ document, alt, src }) {
const img = document.createElement('img')
img.setAttribute('alt', alt)
img.setAttribute('src', src)
return img
}