HTML <script> crossorigin Attribute Last Updated : 26 Mar, 2024 Comments Improve Suggest changes Like Article Like Report The HTML <script> tag with the crossorigin attribute specifies how to handle fetching of external scripts. When set to "anonymous", it indicates that the script should be retrieved without sending user credentials. Cross-Origin Resource Sharing(CORS) is a tool that allows web pages requesting for resources from another domain that is outside of their own domain. It is also used for managing cross-origin requests which is a request for a resource from an outside domain. Syntax: <script crossorigin="anonymous | use-credentials">Attribute Values: AttributeDescriptionanonymousIt has a default value. It defines a CORS request will be sent without passing the credentials information.use-credentialsA cross-origin request will be sent with credentials, cookies, and certificatesNote: This attribute is only valid for use if we try to fetch the resources from the third party domain. Example: In this example the HTML script tag with crossorigin attribute set to "anonymous" for loading my_script.js file. Button for submission included in the body. HTML <!DOCTYPE html> <html> <head> <title> HTML script crossorigin Attribute </title> </head> <body> <h2>HTML script crossorigin Attribute</h2> <br /> <button>Submit</button> <script type="text/javascript" src="my_script.js" crossorigin="anonymous" ></script> </body> </html> Output: HTML Supported Browsers: Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML <script> crossorigin Attribute M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-Tags HTML-Attributes Similar Reads HTML <img> crossorigin Attribute The HTML crossorigin Attribute in is used in <img> element that supports a CORS request when we tried to fetch out the .png or .jpg files from the third party server or from other domain. Syntax <img crossorigin="anonymous | use-credentials"> Attribute Values: anonymous: It has a defaul 1 min read HTML | <script> charset Attribute The HTML <script>charset Attribute is used to specifies the character encoding used in an external script. Syntax: <script charset="charset"> Note: HTML <script>charset Attribute is not supported by HTML5. Attribute Values: It contains the value charset which specifies the characte 1 min read HTML <audio> crossorigin Attribute The HTML crossorigin Attribute is used in the <audio> element that supports a CORS request when we tried to fetch out the audio files from the third-party servers or from another domain. Syntax: <audio crossorigin="anonymous | use-credentials">Attribute Values: anonymous: It has a Defau 1 min read HTML crossorigin Attribute CORS stands for cross-origin resource sharing. It is a mechanism by which one webpage requests to another domain for fetching out the resource like audio, video, script, etc from the third party server without leaking their credentials information.  If specified, the request will be sent with or wit 2 min read HTML | <script> src Attribute The HTML <script> src Attribute is used to specify the URL of external JavaScript file. The External JavaScript file is used to run on the same script on several pages on a website. We can save the JavaScript file with an extension of .js. We can refer the external script using the src attribu 1 min read Like