UNPKG

jdm_javascript_dom_manipulator

Version:
36 lines (24 loc) 881 B
<!DOCTYPE html> <html lang="it"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Jdm</title> <body> <div id="app"></div> <script type="module"> import "../src/jdm.js" //language=html const svgDom = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 50" width="200" height="50"></svg>` const svg = JDM(svgDom, document.body) //language=html const textDom = `<text x="10" y="35" font-family="sans-serif" font-size="24" fill="black">Testo dentro SVG</text>`; JDM(textDom, svg); //language=html const ee = `<div x="10" y="35" font-family="sans-serif" font-size="24" fill="black">Testo dentro SVG</div>`; JDM(ee, document.body); JDM(document.querySelector("#app")); JDM('Qualcosa <span>in mezzo</span>', document.body); </script> </body> </html>