<script src="">

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
<script> HTML Tag
What does <script src=""> do?
Specifies the URL of an external script.

Coding Efficiently

Where possible, it’s good practice to separate JavaScript from HTML by using an external script file and using <script> to import its contents.

The src attribute of <script> is used to specify the URL of the external file.

Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.

Browser Support for src

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll