What should I insert into html so it is ok in code validators?
This is my HTML:

    <!DOCTYPE html>
    <html>

    <head>
    <script>

    function run(){

    var div = document.createElement('div')
    div.style.position = 'absolute'
    div.style.left = 0
    div.style.top = 0
    div.onmouseover=function(){
    alert('mo')
    this.style.opacity = 0
    }
    div.style.width = 30
    div.style.height = 30
    div.style.backgroundColor = '#000'
    document.body.appendChild(div)

    }

    onload = run

    </script>
    <title></title>
 
    </head>

    <body>

    </body>

    </html>

This hmtl runs ok in quirks mode.
But, I know that I need to use some other tags for the html.

I´d like to know...
1 - What other tags should I add, so it runs ok in code validator?

2 - Why my javascript it´s not working with the html5 doctype? (It works ok in quirks mode)

Thanks :)
What should I insert into html so it is ok in code validators?
===

This is my HTML:

    <!DOCTYPE html>
    <html>

    <head>
    <script>

    function run(){

    var div = document.createElement('div')
    div.style.position = 'absolute'
    div.style.left = 0
    div.style.top = 0
    div.onmouseover=function(){
    alert('mo')
    this.style.opacity = 0
    }
    div.style.width = 30
    div.style.height = 30
    div.style.backgroundColor = '#000'
    document.body.appendChild(div)

    }

    onload = run

    </script>
    <title></title>
 
    </head>

    <body>

    </body>

    </html>

This hmtl runs ok in quirks mode.
But, I know that I need to use some other tags for the html.

I´d like to know...
1 - What other tags should I add, so it runs ok in code validator?

2 - Why my javascript it´s not working with the html5 doctype? (It works ok in quirks mode)

Thanks :)