Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

area of a triangle javascript

var a1 = 10
var a2 = 2

console.log((a1 * a2)/2)

// Area would be 10 in this case, formula for triangle area is (base * height) / 2
Comment

javascript find area of triangle

<!DOCTYPE html>
<html>


<head>
<title>HTML5 template</title>
 <link rel="stylesheet" type="text/css" href="homework14.css">

</head>



<body>
<header>Homework 14</header>

<div id="table1">

<div id="table2">

<div id="table3">

<div id="triangle">
<img src="triangle.gif">
</div>

<div id="table4">

<form>
  <label for="width">Width (b):</label>
  <input type="text" id="width" name="width">
  <label for="height">Height (h):</label>
  <input type="text" id="height" name="height">
</form>
Enter the width and height of your triangle to calculate the area


<input type="button" value="Calculate area">
</div>


</div>

<hr>

<div id="table5">

<form>
  <label for="area">The area is:</label>
  <input type="text" id="area" name="area">
</form>

</div>
</div>

</div>

</body>


</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: delete folder with deno 
Javascript :: active-class router-link 
Javascript :: get id value jquery 
Javascript :: foreach method javascript 
Javascript :: hasownproperty javascript 
Javascript :: jquery attribute 
Javascript :: anchor click event angular refresh page 
Javascript :: chart.js clear data 
Javascript :: camelcase 
Javascript :: replace character inside a string in JavaScript 
Javascript :: without refresh update url in js 
Javascript :: javascript date parse yyyy-mm-dd 
Javascript :: or operator javascript 
Javascript :: js object entries 
Javascript :: vue js count down timer 
Javascript :: array index javascript show only first 2 elements 
Javascript :: convert exp date token to date 
Javascript :: javascript continue with for Loop 
Javascript :: select parent of elemt 
Javascript :: export app react native 
Javascript :: String variable props 
Javascript :: multiple export in react 
Javascript :: convert string to lowercase javascript 
Javascript :: json arrays 
Javascript :: js highest number in array 
Javascript :: sweetalert example 
Javascript :: remove duplicates in array 
Javascript :: node schedule every minute 
Javascript :: multiple if statements js es6 inline 
Javascript :: moment all formats in reactjs 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =