HTML <script> integrity Attribute Last Updated : 27 Feb, 2024 Comments Improve Suggest changes 2 Likes Like Report The integrity attribute is used to permit the Browser to check the fetched script to ensure the source code is never loaded. It is used to check whether the third party has altered the resource or not. Subresource Integrity(SRI) is a security feature developed by w3comsortium that is used to permit a Browser to verify all the external scripts that would be fetched. It gives surety that the scripts are not altered by the third party. The working process of SRI is going to follow the steps: The webpage holds the hash value and on the other side, the server holds the .js file.Now, the browser matches the hash value of the integrity attributeIn the end, if the value of hash matches then the file is used otherwise the file is blocked.Syntax <script>permit Attribute Values: filehash: It indicates the hash value of the external script file.Example 1: HTML <!DOCTYPE html> <html> <head> <title> HTML script integrity Attribute </title> </head> <body style="text-align:center;"> <h1> GeeksForGeeks </h1> <h2> HTML script integrity Attribute </h2> <script id="myGeeks" type="text/javascript" src="my_script.js" integrity= "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"> </script> <br> <button>Submit</button> </body> </html> Output: Example 2: HTML <!DOCTYPE html> <html> <head> <title> script tag </title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> HTML integrity Attribute in <script> Element </h2> <p id="Geeks"></p> <script charset="UTF-8" integrity= "e0d123e5f316bef78bfdf5a008837577OOo_2.0.1_LinuxIntel_install.tar.gz"> document.getElementById("Geeks") .innerHTML = "Hello GeeksforGeeks!"; </script> </body> </html> Output: Supported Browsers: Google Chrome 45.0 Edge 17.0 Firefox 43.0Apple safari 11.1 Opera Create Quiz Comment M manaschhabra2 Follow 2 Improve M manaschhabra2 Follow 2 Improve Article Tags : Web Technologies HTML HTML-Tags HTML-Attributes Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like