webpack-configs/static-html/src/js/index.js

20 lines
419 B
JavaScript

import '../css/style.css';
import '../css/style.inline.css';
import MyImage from '../img/my-image.png';
function component() {
const element = document.createElement('div');
element.innerHTML = 'Hai There';
element.classList.add('hello');
const theImage = new Image();
theImage.src = MyImage;
element.appendChild(theImage);
return element;
}
document.querySelector('#js-main').appendChild(component());