index.html:
<script type="module" src="./index.js"></script>
<body>
<button onclick="myFunc()">click</button>
</body>
<script type="module">
import Dog from './dog.js';
let dog = new Dog();
function myFunc(){
dog.doSomething();
}
</script>
The script cant be called since i have type="module". If i dont have module I cant access the Dog class. How do I connect the html events with the modules?
<script type=module>