This code still has one warning in the html code generator. What else do I need to insert into it?

This is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

I seem to have a problem:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">



<script type='text/javascript'>

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

onload = run
</script>
<title></title>

</head>

<body>

</body>

</html>

What else do I need to insert or edit, so that my code will be completely in order to verify the code? Thank:)

+5
source share
1 answer

No problem with this code when dumping in Validator using direct input

http://validator.w3.org/#validate_by_input

One warning you get

Using direct input mode: UTF-8 character encoding is assumed

which you can safely ignore. It just means that UTF-8 is supposed to be direct input.

+11
source

All Articles