The best HTML DOM Script Object Tutorial In 2024, In this tutorial you can learn Script Object,Script Object Properties,Standard properties and events,related articles,
Script object represents an HTML <script> element.
You can use getElementById () to access the <script> element:
You can use the document.createElement () method to create a <script> element:
属性 | 描述 |
---|---|
async | 设置或返回是否异步执行脚本(一旦脚本可用)。 |
charset | 设置或返回脚本的 charset 属性的值。 |
defer | 设置或返回是否在页面完成解析时执行脚本。 |
src | 设置或返回脚本的 src 属性的值。 |
text | 设置或返回脚本的所有子文本节点的内容。 |
type | 设置或返回脚本的 type 属性的值。 |
Script objects also supports standard attributes and events .
HTML Reference Manual: HTML <Script> tag