Combining Js and Html


Hey im trying to combine html and Javascript for the first time, but it is not working to well. Can someone tell me anyway to use html and js together to do the command alert? Thanks in advance.

 <title>JavaScript Hello World</title>
<button onclick="myFunction()">Try it</button>
function myFunction() {
 alert(“Hello World!”);


that didnt work to well either how to i write html here without It using the html xD


this line:

alert(“Hello World!”);

use quotation marks ("), not sure what you are using


Thanks man, it worked! Mark it as solved now if you want