MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

How many ways are there to add JavaScript?

JavaScript

Way of adding JavaScript:

Inline
  • Inside head Tag
  • Inside body Tag
Inside Head Tag
Inside Body Tag

External file

  • Inside head Tag
  • Inside body Tag
Inside head Tag
Inside body Tag
  • <script> – Opening Script Tag.
  • src – It‟s an attribute of script tag. It defines source/location of script file.

• dev.js – This is our script file. Where dev is file name and .js is the extension
of javascript file.

• type – It‟s an attribute of script tag which tells the browser it is a javascript.
This is optional now a days.

• text/javascript – Its type of document

• document.write(“Hello World”); – This is a function to display data.

• </script> Closing Script tag

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x