domstuff

different dom functions

Usage no npm install needed!

<script type="module">
  import domstuff from 'https://cdn.skypack.dev/domstuff';
</script>

README

domstuff

example of usage

addNewListener

this function makes you add a new listener to an element in your DOM.

addNewListener("#edit-btn", "click", function () {
  editTask(task, taskTitle);
});

createDomEle

createDomEle(
  `#${taskTitle}`,
  "div",
  { class: ["class-1", "class-2"], id: "id" }, // id or any attribute
  "this is the text content of the div"
);