<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learn JavaScript Online | Free Interactive JavaScript Tutorials</title>
	<atom:link href="https://javascript-tutor.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>https://javascript-tutor.net/</link>
	<description>Master JavaScript with free, interactive tutorials for beginners and experienced coders. Practice live coding and visualize how JavaScript works step by step.</description>
	<lastBuildDate>Thu, 21 Jun 2018 11:18:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>What is JQuery?</title>
		<link>https://javascript-tutor.net/index.php/2018/06/17/what-is-jquery/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Sun, 17 Jun 2018 09:54:46 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=2586</guid>

					<description><![CDATA[<p>jQuery is a JavaScript library that lets you search for elements in a web document using CSS-style selectors and then performing the elements using certain methods. The purpose of jQuery is to make it much easier to use JavaScript on your website. Besides that, jQuery simplifies a lot of the complicated things from JavaScript, like AJAX calls &#8230; <a href="https://javascript-tutor.net/index.php/2018/06/17/what-is-jquery/" class="more-link">Continue reading<span class="screen-reader-text"> "What is JQuery?"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2018/06/17/what-is-jquery/">What is JQuery?</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>jQuery is a JavaScript library that lets you search for elements in a web document using CSS-style selectors and then performing the elements using certain methods. The purpose of jQuery is to make it much easier to use JavaScript on your website. Besides that, jQuery simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.</p>
<p>We can create a jQuery function using the $() symbol, as follows:</p>
<p><span style="color: #800080;">$(</span><span style="color: #ff6600;">&#8216;li.popular<span style="color: #800080;">&#8216;</span></span><span style="color: #800080;">)</span></p>
<p>This is a CSS-style selector where it finds all the &lt;li&gt;elements with a class of popular.</p>
<p>The jQuery has many methods that we can use to work with the elements we have selected.</p>
<p>For example. we can use the addClass method</p>
<p><span style="color: #800080;">$(</span><span style="color: #ff6600;">&#8216;li.popular<span style="color: #800080;">&#8216;</span></span><span style="color: #800080;">)</span></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2018/06/17/what-is-jquery/">What is JQuery?</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating a Blockchain using JavaScript</title>
		<link>https://javascript-tutor.net/index.php/2018/04/08/creating-a-blockchain-using-javascript/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Sun, 08 Apr 2018 12:09:27 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=2533</guid>

					<description><![CDATA[<p>Cryptocurrency is a hot topic nowadays, especially since the value of Bitcoin has skyrocketed in the past two years. Though it is a volatile investment, many people still go for it. Equally popular topic is the technology behind the cryptocurrency, i.e. the Blockchain. The appeal of the blockchain is that it can be applied to other &#8230; <a href="https://javascript-tutor.net/index.php/2018/04/08/creating-a-blockchain-using-javascript/" class="more-link">Continue reading<span class="screen-reader-text"> "Creating a Blockchain using JavaScript"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2018/04/08/creating-a-blockchain-using-javascript/">Creating a Blockchain using JavaScript</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Cryptocurrency is a hot topic nowadays, especially since the value of Bitcoin has skyrocketed in the past two years. Though it is a volatile investment, many people still go for it.</p>
<p>Equally popular topic is the technology behind the cryptocurrency, i.e. the Blockchain. The appeal of the blockchain is that it can be applied to other industries other than cryptocurrency. The blockchain is a distributed ledger technology that provides a way to record and transfer data that is transparent, safe, auditable, and resistant to outages. The blockchain has the ability to make the organizations that use it transparent, democratic, decentralized, efficient, and secure.</p>
<p>In this article, we are keen to explore how JavaScript can be used to create a blockchain. There are many programming languages that are suitable to be used to write blockchain script, among them, VB.Net, Java, C++, Python, Solidity and of course, JavaScript.</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2018/04/08/creating-a-blockchain-using-javascript/">Creating a Blockchain using JavaScript</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating Animation in JavaScript</title>
		<link>https://javascript-tutor.net/index.php/2017/09/14/creating-animation-javascript/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Thu, 14 Sep 2017 10:10:52 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=2205</guid>

					<description><![CDATA[<p>You can create an animation in JavaScript easily using the setInterval method, the syntax is as follows: myVariable=setInterval(myfunction, time interval) The setInterval method runs a function created by you at a certain time interval in milliseconds. For example, a time interval of 1000 equals to 1 second. Here are some examples of animations created by us: &#8230; <a href="https://javascript-tutor.net/index.php/2017/09/14/creating-animation-javascript/" class="more-link">Continue reading<span class="screen-reader-text"> "Creating Animation in JavaScript"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/09/14/creating-animation-javascript/">Creating Animation in JavaScript</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You can create an animation in JavaScript easily using the</p>
<p><strong>setInterval</strong> method, the syntax is as follows:</p>
<pre>myVariable=setInterval(myfunction, time interval)
</pre>
<p>The setInterval method runs a function created by you at a certain time interval in milliseconds. For example, a time interval of 1000 equals to 1 second.</p>
<p>Here are some examples of animations created by us:</p>
<ul>
<li><a href="http://javascript-tutor.net/index.php/animated-digital-dice/">Animated Digital Dice</a></li>
<li><a href="http://javascript-tutor.net/index.php/animated-dice/">Animated Graphical Dice</a></li>
<li><a href="http://javascript-tutor.net/index.php/animated-butterfly/">Animated Butterfly</a></li>
</ul>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/09/14/creating-animation-javascript/">Creating Animation in JavaScript</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The fromCharCode() Method</title>
		<link>https://javascript-tutor.net/index.php/2017/07/21/the-fromcharcode-method/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 02:39:41 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=2054</guid>

					<description><![CDATA[<p>The fromCharCode() Method is a method that belongs to the String object in JavaScript. It converts a Unicode into a corresponding character. You can refer to the Unicode Table to look up for a certain Unicode for a certain character or symbol. For example,  The character of Unicode 78 is N. Follow our JavaScript Tutorial Lesson 11 to learn &#8230; <a href="https://javascript-tutor.net/index.php/2017/07/21/the-fromcharcode-method/" class="more-link">Continue reading<span class="screen-reader-text"> "The fromCharCode() Method"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/21/the-fromcharcode-method/">The fromCharCode() Method</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The fromCharCode() Method is a method that belongs to the String object in JavaScript. It converts a Unicode into a corresponding character. You can refer to the <a href="https://unicode-table.com/en/">Unicode Table</a> to look up for a certain Unicode for a certain character or symbol. For example,  The character of Unicode <b id="chr1">78</b> is <b id="chr">N.</b></p>
<p>Follow our JavaScript <a href="http://javascript-tutor.net/index.php/lesson-11-objects-part-3-string-object/">Tutorial Lesson 11</a> to learn more about the  fromCharCode() Method</p>
<p>&nbsp;</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/21/the-fromcharcode-method/">The fromCharCode() Method</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Drawing a Quadratic Curve</title>
		<link>https://javascript-tutor.net/index.php/2017/07/15/drawing-quadratic-curve/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Sat, 15 Jul 2017 04:18:54 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=2037</guid>

					<description><![CDATA[<p>To draw a quadratic curve, we use the quadraticCurve() method. However, we need to combine the quadraticCurve() method with the beginPath() and moveTo() methods in order to draw a quadratic curve. The beginPath() and moveTo() methods define the starting point of the quadratic curve. The quadraticCurve() method is to define the lowest point to the &#8230; <a href="https://javascript-tutor.net/index.php/2017/07/15/drawing-quadratic-curve/" class="more-link">Continue reading<span class="screen-reader-text"> "Drawing a Quadratic Curve"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/15/drawing-quadratic-curve/">Drawing a Quadratic Curve</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To draw a quadratic curve, we use the quadraticCurve() method. However, we need to combine the quadraticCurve() method with the beginPath() and moveTo() methods in order to draw a quadratic curve. The beginPath() and moveTo() methods define the starting point of the quadratic curve. The quadraticCurve() method is to define the lowest point to the end point of the quadratic curve. The syntax of the quadraticCurve() method is</p>
<p>Please follow the following link to learn more.</p>
<p><a href="http://javascript-tutor.net/index.php/javascript-quadratic/">Drawing a Quadratic Curve</a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/15/drawing-quadratic-curve/">Drawing a Quadratic Curve</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Pythagoras Theorem</title>
		<link>https://javascript-tutor.net/index.php/2017/07/14/pythagoras-theorem/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Fri, 14 Jul 2017 03:52:44 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=1999</guid>

					<description><![CDATA[<p>Pythagoras Theorem is used to solve problems related to the length of the sides of a triangle. The formula to  is AB2+AC2=BC2 AB  is the opposite side, AC is the adjacent and BC is the hypotenuse of a triangle ABC. We shall create a JavaScript application to deal with problems related to Pythagoras Theorem. In this application, &#8230; <a href="https://javascript-tutor.net/index.php/2017/07/14/pythagoras-theorem/" class="more-link">Continue reading<span class="screen-reader-text"> "Pythagoras Theorem"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/14/pythagoras-theorem/">Pythagoras Theorem</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Pythagoras Theorem is used to solve problems related to the length of the sides of a triangle.<br />
The formula to  is</p>
<p><strong>AB<sup>2</sup>+AC<sup>2</sup>=BC<sup>2</sup></strong></p>
<p>AB  is the opposite side, AC is the adjacent and BC is the hypotenuse of a triangle ABC.</p>
<p>We shall create a JavaScript application to deal with problems related to Pythagoras Theorem. In this application, we shall insert two input boxes for the user to key in the length of the opposite side and the length of the adjacent side. The user can then click on the Calculate Hypotenuse button to find the answer.</p>
<p>Read more here</p>
<p><a href="http://javascript-tutor.net/index.php/pythagoras-theorem/"Pythagoras Theorem/</a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2017/07/14/pythagoras-theorem/">Pythagoras Theorem</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>BMI Calculator</title>
		<link>https://javascript-tutor.net/index.php/2016/08/17/bmi-calculator/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Wed, 17 Aug 2016 09:00:32 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=1592</guid>

					<description><![CDATA[<p>You can create a BMI calculator using JavaScript. The formula for BMI(Body Mass Index) is as follows: BMI=weight/(height)^2 where weight is in kg and height in cm. In the html page, you can create three text box using the &#60;input&#62; tag to accept the user inputs for name, height and weight. In the JavaScript, you can &#8230; <a href="https://javascript-tutor.net/index.php/2016/08/17/bmi-calculator/" class="more-link">Continue reading<span class="screen-reader-text"> "BMI Calculator"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/08/17/bmi-calculator/">BMI Calculator</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You can create a BMI calculator using JavaScript. The formula for BMI(Body Mass Index) is as follows:</p>
<p><strong>BMI=weight/(height)^2</strong></p>
<p>where weight is in kg and height in cm.</p>
<p>In the html page, you can create three text box using the &lt;input&gt; tag to accept the user inputs for name, height and weight.</p>
<p>In the JavaScript, you can create a function to calculate the bmi, as follows:</p>
<p>function bmi(){</p>
<p>var sheight=parseFloat(document.getElementById(&#8216;hgt&#8217;).value);<br />
var sweight=parseFloat(document.getElementById(&#8216;wgt&#8217;).value);<br />
var bmi=sweight/Math.pow(sheight,2);<br />
var student_bmi=document.getElementById(&#8216;bmi_index&#8217;);<br />
student_bmi.textContent=bmi.toFixed(2);<br />
}</p>
<ul>
<li>toFixed method is to round the output to 2 decimal ppalces</li>
</ul>
<p>The html document is</p>
<p>&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;h1&gt;Student Name=&lt;input type=&#8221;text&#8221; style=&#8221;font-size:25px; font-weight: bold;&#8221; id=&#8221;studentname&#8221;&gt;&lt;/h1&gt;<br />
&lt;h2&gt;Height=&lt;input type=&#8221;text&#8221; style=&#8221;font-size:20px; font-weight: bold;&#8221; id=&#8221;hgt&#8221;&gt;&lt;/h2&gt;<br />
&lt;h2&gt;Weight=&lt;input type=&#8221;text&#8221; style=&#8221;font-size:20px; font-weight: bold;&#8221; id=&#8221;wgt&#8221;&gt;&lt;/h2&gt;<br />
&lt;h2&gt;BMI=&lt;b id=&#8221;bmi_index&#8221;&gt;&lt;/b&gt;&lt;/h2&gt;</p>
<p>&lt;input type=&#8221;button&#8221; value=&#8221;Calculate&#8221; onclick=&#8221;bmi()&#8221;&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;bmi2.js&#8221;&gt;&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Click <a href="http://javascript-tutor.net/jSample/bmi2.html">here</a> to launch the BMI calculator</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/08/17/bmi-calculator/">BMI Calculator</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating a math drill for calculating volume of a cuboid</title>
		<link>https://javascript-tutor.net/index.php/2016/07/25/creating-math-drill-calculating-volume-cuboid/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Mon, 25 Jul 2016 03:48:20 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=1529</guid>

					<description><![CDATA[<p>We have learned how to create a calculator that calculates the volume of a cuboid. Using the similar script, we can write a JavaScript that allows the user to input the dimensions as well as  enter the answer. If the answer is wrong, it will displays the &#8220;Incorrect&#8221; message, otherwise it will show the &#8220;Correct&#8221; message. &#8230; <a href="https://javascript-tutor.net/index.php/2016/07/25/creating-math-drill-calculating-volume-cuboid/" class="more-link">Continue reading<span class="screen-reader-text"> "Creating a math drill for calculating volume of a cuboid"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/25/creating-math-drill-calculating-volume-cuboid/">Creating a math drill for calculating volume of a cuboid</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We have learned how to create a calculator that calculates the volume of a cuboid. Using the similar script, we can write a JavaScript that allows the user to input the dimensions as well as  enter the answer. If the answer is wrong, it will displays the &#8220;Incorrect&#8221; message, otherwise it will show the &#8220;Correct&#8221; message.</p>
<p>The JavaScript is as follows:&#8217;</p>
<p>function Calvol(width, length, height){<br />
var vol=width*length*height;<br />
return vol;<br />
}<br />
function CalSize(){<br />
var x=parseInt(document.getElementById(&#8220;wdt&#8221;).value);<br />
var y=parseInt(document.getElementById(&#8220;lgt&#8221;).value);<br />
var z=parseInt(document.getElementById(&#8220;hgt&#8221;).value);<br />
var Size=Calvol(x,y,z);<br />
var answer=document.getElementById(&#8216;ans1&#8217;).value;<br />
if (answer==Size)<br />
{message=&#8221;Correct&#8221;;}</p>
<p>else<br />
{message=&#8221;Incorrect, try again&#8221;;}</p>
<p>document.getElementById(&#8216;ans&#8217;).textContent=message;</p>
<p>}</p>
<p>And the html is as follows:</p>
<p>&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=windows-1252&#8243;&gt;<br />
&lt;title&gt;Volume Calculation&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body onload=&#8221;RandomFn()&#8221;&gt;<br />
&lt;h1&gt;Volume of a Cuboid&lt;/h1&gt;<br />
&lt;p&gt;Width&amp;nbsp;=&amp;nbsp;&amp;nbsp;&lt;input type=&#8221;text&#8221; size=&#8221;5&#8243; id=&#8221;wdt&#8221;&gt;&lt;/p&gt;<br />
&lt;p&gt;Length=&amp;nbsp;&lt;input type=&#8221;text&#8221; size=&#8221;5&#8243; id=&#8221;lgt&#8221;&gt;&lt;/p&gt;<br />
&lt;p&gt;Height=&amp;nbsp;&lt;input type=&#8221;text&#8221; size=&#8221;5&#8243; id=&#8221;hgt&#8221;&gt;&lt;/p&gt;</p>
<p>&lt;h3&gt;The Volume is&lt;/h3&gt;</p>
<p>&lt;input type=&#8221;text&#8221; size=&#8221;5&#8243; id=&#8221;ans1&#8243;&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;h3 id=&#8221;ans&#8221;&gt;&lt;h3&gt;<br />
&lt;script&gt;<br />
function Nextq() {<br />
location.reload();<br />
}<br />
&lt;/script&gt;<br />
&lt;input type=&#8221;button&#8221; value=&#8221;Check Answer&#8221; onclick=&#8221;CalSize()&#8221;&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;input type=&#8221;button&#8221; value=&#8221;Next Question&#8221; onclick=&#8221; location.reload();&#8221;&gt;<br />
&lt;script&gt;<br />
function RandomFn() {<br />
document.getElementById(&#8220;wdt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
document.getElementById(&#8220;lgt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
document.getElementById(&#8220;hgt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
}<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;volume2.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Click <a href="http://javascript-tutor.net/jsample/volume2.html">Here</a> to run the script.</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/25/creating-math-drill-calculating-volume-cuboid/">Creating a math drill for calculating volume of a cuboid</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating a function that calculates the volume of a cuboid</title>
		<link>https://javascript-tutor.net/index.php/2016/07/23/creating-function-calculates-function-cuboid/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Sat, 23 Jul 2016 13:24:03 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=1487</guid>

					<description><![CDATA[<p>We have learned how to create a function that have arguments. In this example, we shall show you how to create a function that calculated the volume of cuboid give the width, length and height of the cuboid. The JavaScript function to calculate the volume is function Calvol(width, length, height){ var vol=width*length*height; return vol; } &#8230; <a href="https://javascript-tutor.net/index.php/2016/07/23/creating-function-calculates-function-cuboid/" class="more-link">Continue reading<span class="screen-reader-text"> "Creating a function that calculates the volume of a cuboid"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/23/creating-function-calculates-function-cuboid/">Creating a function that calculates the volume of a cuboid</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We have learned how to create a function that have arguments. In this example, we shall show you how to create a function that calculated the volume of cuboid give the width, length and height of the cuboid.</p>
<p>The JavaScript function to calculate the volume is</p>
<p>function Calvol(width, length, height){<br />
var vol=width*length*height;<br />
return vol;<br />
}</p>
<p>The JavaScript function to call the Calvol() function by replacing the parameters with the arguments generate by the HTML document is</p>
<p>function CalSize(){<br />
var x=parseInt(document.getElementById(&#8220;wdt&#8221;).innerHTML);<br />
var y=parseInt(document.getElementById(&#8220;lgt&#8221;).innerHTML);<br />
var z=parseInt(document.getElementById(&#8220;hgt&#8221;).innerHTML);<br />
var Size=Calvol(x,y,z);<br />
document.getElementById(&#8216;ans&#8217;).textContent=&#8221;The Volume is= &#8220;+Size;<br />
}</p>
<p>The HTML document is</p>
<p>&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=windows-1252&#8243;&gt;<br />
&lt;title&gt;Volume Calculation&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body onload=&#8221;RandomFn()&#8221;&gt;<br />
&lt;h1&gt;Volume Calculation&lt;/h1&gt;<br />
&lt;p&gt;Width=&lt;b id=&#8221;wdt&#8221;&gt;&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;Length=&lt;b id=&#8221;lgt&#8221;&gt;&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;Height=&lt;b id=&#8221;hgt&#8221;&gt;&lt;/b&gt;&lt;/p&gt;<br />
&lt;P id=&#8221;ans&#8221;&gt;What is the Volume?&lt;/p&gt;<br />
&lt;input type=&#8221;button&#8221; value=&#8221;Calculate Volume&#8221; onclick=&#8221;CalSize()&#8221;&gt;&lt;br&gt;&lt;br&gt;<br />
&lt;input type=&#8221;button&#8221; value=&#8221;Next Question&#8221; onclick=&#8221; location.reload();&#8221;&gt;<br />
&lt;script&gt;<br />
function RandomFn() {<br />
document.getElementById(&#8220;wdt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
document.getElementById(&#8220;lgt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
document.getElementById(&#8220;hgt&#8221;).innerHTML = parseInt(Math.random()*9+1);<br />
}<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;volume.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>Click <a href="http://javascript-tutor.net/jSample/volume.html">Here</a> to check it out</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/23/creating-function-calculates-function-cuboid/">Creating a function that calculates the volume of a cuboid</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Adding arguments to a JavaScript function</title>
		<link>https://javascript-tutor.net/index.php/2016/07/21/adding-arguments-function/</link>
		
		<dc:creator><![CDATA[Liew Voon Kiong]]></dc:creator>
		<pubDate>Thu, 21 Jul 2016 08:18:37 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://javascript-tutor.net/?p=1474</guid>

					<description><![CDATA[<p>You can create a function in JavaScript and add arguments to it. An argument is one or more variables that are declared within the parenthesis of a function definition. The syntax is function  MyFunction(x,y,z) {  statements;} You can also use the return keyword to return a value to the statement. function  MyFunction(x,y,z) {  return value; } &#8230; <a href="https://javascript-tutor.net/index.php/2016/07/21/adding-arguments-function/" class="more-link">Continue reading<span class="screen-reader-text"> "Adding arguments to a JavaScript function"</span></a></p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/21/adding-arguments-function/">Adding arguments to a JavaScript function</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>You can create a function in JavaScript and add arguments to it. An argument is one or more variables that are declared within the parenthesis of a function definition. The syntax is</p>
<p>function  MyFunction(x,y,z)</p>
<p>{  statements;}</p>
<p>You can also use the return keyword to return a value to the statement.</p>
<p>function  MyFunction(x,y,z)</p>
<p>{  return value; }</p>
<p>Example:</p>
<p>function Area_Rect(width,length)</p>
<p>{ area=width*length;</p>
<p>return area;}</p>
<p>You can call the function by assigning values to the arguments, such as</p>
<p>document.write(Area_Rect(4,6));</p>
<p>0r alert (&#8220;The area of a rectangle is&#8221;+Area_Rect(4,6)</p>
<p>The area of the rectangle if width=4 and length=6 is:<br />
<script>// <![CDATA[
function Area_Rect(width,length) { area=width*length; return area;} document.write("The area of the rectangle is "+Area_Rect(4,6));
// ]]&gt;</script></p>
<p>Please follow <a href="http://javascript-tutor.net/index.php/lesson-13-function-part-1-introduction/">Lesson 13</a> and <a href="http://javascript-tutor.net/index.php/lesson-14-function-part-2-more-examples/">Lesson 14</a> to learn more about function.</p>
<p>The post <a href="https://javascript-tutor.net/index.php/2016/07/21/adding-arguments-function/">Adding arguments to a JavaScript function</a> appeared first on <a href="https://javascript-tutor.net">Learn JavaScript Online | Free Interactive JavaScript Tutorials</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
