XHTML文件头部分中的事件驱动函数

Event-driven functions in the head section of an XHTML file

本文关键字:事件驱动 函数 文件 头部 XHTML      更新时间:2023-09-26

我有一个任务有一些要求,下面是其中一个:"脚本应编码为XHTML文件头部分中的事件驱动函数"。请在XHTML文件

的头部指定什么是事件驱动的函数

XHTML5模板供您使用。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Example</title>
<script defer="defer" type="application/javascript">
//<![CDATA[
window.onblur = function(event)
{
}

window.onclick = function(event)
{
}

window.onload = function(event)
{
 alert('Script events in the head section of the example.xhtml file.');
}
//]]>
</script>
</head>
<body>
<main>
<h1>Example Page</h1>
</main>
</body>
</html>