1.

When does JavaScript code appear inline within an HTML file?(a) Between the “script” tag(b) Outside the “script” tag(c) Between or Outside the “script” tag(d) Between the header tagThis question was addressed to me in an online interview.My question is taken from Embedding JavaScript in HTML topic in section Server-Side and Client-Side Scripting of JavaScript

Answer»

Correct option is (a) Between the “SCRIPTTAG

To elaborate: JavaScript code can appear inline within an HTML file between the “script” tags. Javascript can also be included from an external file SPECIFIED by the src ATTRIBUTE of a “script” tag.



Discussion

No Comment Found

Related InterviewSolutions