answersLogoWhite

0

To add javascript code in HTML, you have to include the script tag on top. It can be added as <script src="source of script"></script>

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

Why browser having only HTML code?

HTML is the standard for defining web page element and is supported by all browsers. but webpages have also JavaScript and cs code as well.


How do you write a javascript?

go to notepad and write Javascript code and save it as .js and then import it into a page with a src tag


Which are the new element of HTML5 that lets scripting applications dynamicaly render graphics animations or other visual images?

is a new HTML5 element that allows scripts (usually JavaScript) to draw graphics on the fly. The container holds the JavaScript code that does the actual drawing.


How do you put java script into HTML?

Javascript inside html &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" language="javascript"&gt; // Java script code here &lt;/script&gt; &lt;body&gt; // html code here &lt;/body&gt; &lt;/html&gt; Via External Link: &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" language="javascript" src="location of js file"&gt; &lt;/script&gt; &lt;body&gt; // html code here &lt;/body&gt; &lt;/html&gt;


What is embedding java script?

To embed JavaScript code is to include it in the HTML page. For example, this will embed the code to display an alert: &lt;script type="text/javascript"&gt; alert("Embedded alert!"); &lt;/script&gt;


What is a inspect element?

Inspect element is nothing but the properties of respective pages you open in the web. you can see these properties by clicking right mouse button click and select 'inspect element' and you can change the properties too but it'll not help you much because once you reload the page the changes you made will not get saved and old property will act on the page. you can use the inspect element option for study purpose, like, what type of properties they insert to make those web pages, this is for software engineer's and developer's.


What is the Javascript onclick?

The Javascript onclick function is a popular part of Javascript. The Javascript onclick function makes it easy and simple for one to quickly link a page.


Is JavaScript code executed when the page is loaded or when instructed to by the web code?

That depends. If you just put some javascript code somewhere (like document.write('hello')) it will be executed on page load. However, you'll mostly want to use functions; you then call those functions on certain events (like a button onclick) to execute their code.


What language is Facebook written in?

xhtml and javascript mostly...probably with extra code for specific functions. to find out a web page's source code right-click page and select "view page source"


How is the main content area of a page described in HTML code?

The main content of the page is wrapped with BODYtags:... meta data, title, javascript, etc. ...... main content and more HTML code ...


What is the command to display HTML page through javascript?

If you're planning on linking to another page, all you have to write is: document.location = "yourNewURL"; If you want to generate Javascript, then you can either use: document.write("your HTML Code"); OR send the HTML code to an existing object in an HTML page, like so: document.getElementById['targetElement'].innerHTML = "your HTML Code here"; ----------------- That's pretty much it. If you want me to elaborate, please let me know. :)


How does javascript work?

JavaScript is what is called a Client-side Scripting Language. That means that it is a computer programming language that runs inside an Internet browser (a browser is also known as a Web client because it connects to a Web server to download pages). Inside a normal web page you place a JavaScript code inside. When the browser loads the page, the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it. Web page designers use JavaScript in many different ways. One of the most common is to do field validation in a form. Many websites gather information from users in online forms, and JavaScript can help validate entries. For example, the programmer might validate that a person's age entered into a form falls between 1 and 120.