Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 49
» Latest member: antwantillman
» Forum threads: 4,492
» Forum posts: 4,495

Full Statistics

Online Users
There are currently 1034 online users.
» 0 Member(s) | 1032 Guest(s)
Bing, Yandex

Latest Threads
SELECT statement with MS ...
Forum: MS Access SQL Tutorials
Last Post: Qomplainerz
07-27-2023, 03:35 PM
» Replies: 0
» Views: 1,080
SELECT statement with the...
Forum: MS Access SQL Tutorials
Last Post: Qomplainerz
07-27-2023, 03:31 PM
» Replies: 0
» Views: 529
Creating hyperlinks in HT...
Forum: HTML5 Tutorials
Last Post: Qomplainerz
07-27-2023, 01:23 PM
» Replies: 0
» Views: 829
What's new in HTML5?
Forum: HTML5 Tutorials
Last Post: Qomplainerz
07-27-2023, 12:48 PM
» Replies: 0
» Views: 555
What is HTML5?
Forum: HTML5 Tutorials
Last Post: Qomplainerz
07-27-2023, 12:43 PM
» Replies: 0
» Views: 520
Neck isometric exercises
Forum: Exercises
Last Post: Qomplainerz
07-27-2023, 11:44 AM
» Replies: 0
» Views: 811
Shoulder shrug
Forum: Exercises
Last Post: Qomplainerz
07-27-2023, 11:43 AM
» Replies: 0
» Views: 476
Neck retraction
Forum: Exercises
Last Post: Qomplainerz
07-27-2023, 11:43 AM
» Replies: 0
» Views: 438
Neck flexion and extensio...
Forum: Exercises
Last Post: Qomplainerz
07-27-2023, 11:42 AM
» Replies: 0
» Views: 506
Neck rotation
Forum: Exercises
Last Post: Qomplainerz
07-27-2023, 11:42 AM
» Replies: 0
» Views: 478

 
  JavaScript - Divisions with values
Posted by: Qomplainerz - 04-04-2023, 08:00 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 4 / 2;

document.getElementById("demo").innerHTML = a;

Print this item

  JavaScript - Divisions with variables
Posted by: Qomplainerz - 04-04-2023, 08:00 AM - Forum: JavaScript Tutorials - No Replies

let a = 4;
let b = 2;
let c = a / b;

document.getElementById("demo").innerHTML = c;

Print this item

  JavaScript - Divisions with expressions
Posted by: Qomplainerz - 04-04-2023, 07:59 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 8;
let b = (8 / 2) / 2;

document.getElementById("demo").innerHTML = b;

Print this item

  JavaScript - Exponentiations with values
Posted by: Qomplainerz - 04-04-2023, 07:59 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 3 ** 3;

document.getElementById("demo").innerHTML = a;

Print this item

  JavaScript - Exponentiations with variables
Posted by: Qomplainerz - 04-04-2023, 07:58 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 3;
let b = 3;
let c = a ** b;

document.getElementById("demo").innerHTML = c;

Print this item

  JavaScript - Exponentiations with expressions
Posted by: Qomplainerz - 04-04-2023, 07:58 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = (2 ** 2) ** 2;

document.getElementById("demo").innerHTML = a;

Print this item

  JavaScript - Modulus with values
Posted by: Qomplainerz - 04-04-2023, 07:57 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 3 % 2;

document.getElementById("demo").innerHTML = a;

Print this item

  JavaScript - Modulus with variables
Posted by: Qomplainerz - 04-04-2023, 07:57 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = 3;
let b = 2;
let c = a % b;

document.getElementById("demo").innerHTML = c;

Print this item

  JavaScript - Modulus with expressions
Posted by: Qomplainerz - 04-04-2023, 07:56 AM - Forum: JavaScript Tutorials - No Replies

Code:
let a = (9 % 2) % 2;

document.getElementById("demo").innerHTML = a;

Print this item

  JavaScript exercises and solutions - Identify if a number is odd or even
Posted by: Qomplainerz - 04-04-2023, 07:56 AM - Forum: JavaScript Tutorials - No Replies

The HTML part between the <body></body> tags looks like this:

Code:
Please enter a number here:
<br>
<input type="Text" id="Num1">
<br>
<input type="button" id="submit" value="submit" onclick="oddOrEven()"></input>
<p id="Output"></p>
<input type="button" id="reset" value="Reset" onclick="Reset()"></input>

The JavaScript part looks like this:

Code:
function oddOrEven()
{
  Num1 = document.getElementById("Num1").value;
 
  if(Num1 % 2 == 0)
    {
      document.getElementById("Output").innerHTML = "Even";
    }
  else
    {
      document.getElementById("Output").innerHTML = "Odd";
    }
}

function Reset()
{
  document.getElementById("Num1").value = "";
  document.getElementById("Output").innerHTML = "";
}

Print this item