HTML DOM Script Objekto

Script object

The Script object represents the HTML <script> element.

Access Script object

You can access the <script> element by using getElementById():

var x = document.getElementById("myScript");

Try it yourself

Create Script object

You can create a <script> element by using the document.createElement() method:

var x = document.createElement("SCRIPT");

Try it yourself

Script object properties

Atribute Description
async Set or return whether the script should be executed asynchronously once it is available.
charset Set or return the script's charset attribute value.
crossOrigin Set or return the script's CORS settings.
defer Set or return whether the script should be executed after the page is fully parsed.
src Set or return the script's src attribute value.
text Set or return the content of all text nodes that belong to the script subnodes.
type Set or return the script's type attribute value.

Standard na Atribute at Kaganapan

Standard ng Suporta ng Objekto ScriptAtributeAtKaganapan.

Mga Kaugnay na Pahina

HTML Tagalang Balita:HTML <script> Tag