answersLogoWhite

0


Best Answer

<html>

<head>

<script language="JavaScript">

function TriaAngle (base, height)

{

document.write("the area of the triangle is" +1/2*base*height)

}

</script></head>

<body>

<script language ="JavaScript">

var b=(prompt ("enter the base of the triangel"))

var h=(prompt ("enter the height of the triangle"))

TriaAngel (b,h)

</script ></body></html>

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Javascript code for the area of a triangle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a javascript tutorial?

A JavaScript tutorial contains instructions that will teach you how to code in JavaScript.


Is jQuery a high level language?

jQuery is like an advanced JavaScript code. jQuery is a JavaScript code library that gives you more features with less code that what Javascript would require. If you understand JavaScript, jQuery wouldn't be much of a change.


How can you script your ASP code in JavaScript?

Start the document with: &lt;%@ language="javascript" %&gt;


How do you add a click event to a java button?

we can do this using of javascript. you can use this following code: &lt;input type=button value="button" onClick=onclick_function()&gt; here onclick_function() is a function which is called by javascript on clicking the button. javascript code is as follows: &lt;script language="javascript" type="text/javascript"&gt; // your code for onclick_function() function onclick_function(){ alert("Welcome to javascript"); } &lt;/script&gt;


What is the javascript code for gaiaonline?

javascript: document.body.contentEditable = 'true'; document.designMode = 'on'; void 0


How do you get the popup javascript box?

Use confirm or alert in javascript code to get a popup


What is the code for JavaScript?

JavaScript code looks like this:function sayhi(name) {alert("Hey there, "+name);}sayhi("joe");


Why is your javascript not working?

If there is no actual error in the code itself, most likely javascript is disabled in the browser.


How do you save javascript on Roblox?

It is not possible to save and execute Javascript code on Roblox. You can save Javascript code as plain text in script objects, but there is no way to execute the code. Roblox uses a scripting language called LUA in-game which is somewhat similar to JavaScript, but it is not identicle. You can learn about LUA syntax on the Roblox wiki.


Can you incorporate a javascript code into asp?

Yes


How reliable is JavaScript?

As reliable as the code writer.


What additional code is generated by Dreamweaver when rollovers are inserted?

Javascript code.