top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How can I link a javascript file to a HTML file?

+2 votes
How can I link a javascript file to a HTML file?
posted Mar 23, 2017 by Richa Patil

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Please follow the following syntax

<script src="JavaScript File-Name" type="text/javascript"></script>

You can include the above at any line based on your need, not necessary only in head section.

answer Mar 24, 2017 by Salil Agrawal
–1 vote

First you need to download JQuery library from then load the jquery library the following way within your html head tags

then you can test whether the jquery is working by coding your jquery code after the jquery loading script

<!DOCTYPE html>
<html xmlns="">
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
      alert("My First Jquery Test");

If you want to use your jquery scripts file seperately you must define the external .js file this way after the jquery library loading.

<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script src="js/YourExternalJQueryScripts.js"></script>
answer Mar 24, 2017 by Manikandan J
Similar Questions
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.