A PHP Error was encountered

Severity: Notice

Message: Undefined index: id

Filename: controllers/Categories.php

Line Number: 97

Backtrace:

File: /home/knowzuml/public_html/application/controllers/Categories.php
Line: 97
Function: _error_handler

File: /home/knowzuml/public_html/index.php
Line: 315
Function: require_once

JavaScript Tutorials

Please login to start chat

 
Web Service & ICT Solutions 22 Oct 2022, 10:15:47
  • Category : JavaScript Tutorials
  • JavaScript Array Methods

    entries()
        Returns a key/value pair Array Iteration Object

    every()
        Checks if every element in an array pass a test in a testing function.

    fill()
        Fill the…

     
    Web Service & ICT Solutions 25 Jun 2022, 11:43:29
  • Category : JavaScript Tutorials
  • Input Datetime Local (HTML Objects)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Testing</title>
    </head>
    <body>
    <button onclick = "jsFun()">Try It</button>
    <script>
    function jsFun(){
    var x = document.createElement("INPUT");
    x.setAttribute("type", "datetime-local");
    document.body.appendChild(x);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 25 Jun 2022, 11:42:26
  • Category : JavaScript Tutorials
  • Input Date (HTML Objects)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Test</title>
    </head>
    <button onclick = "jsFun()">Try It</button>
    <body>
    <script>
    function jsFun(){
    var x = document.createElement("INPUT");
    x.setAttribute("type", "date");
    document.body.appendChild(x);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 25 Jun 2022, 11:41:01
  • Category : JavaScript Tutorials
  • JS Event Listener 2

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>

    <button type = "button" id = "event">Try It</button>
    <p id = "demo"></p>
    <script>
    var x = document.getElementById("event");
    x.addEventListener("mouseover", jsFun1);
    x.addEventListener("mousedown", jsFun2);
    x.addEventListener("mouseout", jsFun3);

    function jsFun1(){
    document.getElementById("demo").innerHTML += "Mouse Over<br />";
    }

    function jsFun2(){
    document.getElementById("demo").innerHTML += "Mouse Down<br />";
    }

    function…

     
    Web Service & ICT Solutions 25 Jun 2022, 11:40:30
  • Category : JavaScript Tutorials
  • JS Event Listener 1

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">The Date is:</p>
    <button type = "button" id = "test">Show Date</button>&nbsp;&nbsp;
    <button type = "button" id = "test1">Hide</button>
    <script>
    document.getElementById("test").addEventListener('click', jsFun);
    document.getElementById("test1").addEventListener('click', jsHide);

    function jsFun(){
    document.getElementById("demo").innerHTML = Date();
    }

    function jsHide(){
    document.getElementById("demo").innerHTML = "";
    }

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

     
    Web Service & ICT Solutions 25 Jun 2022, 11:39:36
  • Category : JavaScript Tutorials
  • timer (HTML DOM Window)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Testing</title>
    </head>
    <body>
    <button onclick = "startCount()">Start Count</button>
    <input type = "text" id = "txt">
    <button onclick = "stopCount()">Stop Count</button>
    </body>
    <script>
    var c = 0;
    var t;
    var myTimer = 0;

    function jsFun(){
    document.getElementById("txt").value = c;
    c++;
    t = setTimeout(jsFun,…

     
    Web Service & ICT Solutions 25 Jun 2022, 11:39:05
  • Category : JavaScript Tutorials
  • progressBar (HTML DOM Window)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Testing</title>
    <style>
    #progressBar{
    width: 100%;
    height: 30px;
    position: relative;
    background-color: grey;
    }

    #myBar{
    width: 20px;
    height: 30px;
    position: absolute;
    background-color: green;
    }
    </style>
    </head>
    <body>
    <div id = "progressBar">
    <div id = "myBar"></div>
    </div><p></p>
    <button onclick = "myMove()">Try Now</button>
    <script>
    function myMove(){
    var ele = document.getElementById("myBar");
    var width =…

     
    Web Service & ICT Solutions 25 Jun 2022, 11:38:30
  • Category : JavaScript Tutorials
  • moveTo (HTML DOM Window)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Testing</title>
    </head>
    <body>
    <button onclick = "openWin()">Open Window</button>
    <button onclick = "moveWin()">Move Window</button>
    <script>
    function openWin(){
    myWindow = window.open('', 'myWindow', 'width=300px, height=200px');
    myWindow.document.write('hello');
    myWindow.document.designMode = "On";
    }

    function moveWin(){
    myWindow.moveTo(500, 300);
    myWindow.focus();
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 25 Jun 2022, 11:37:55
  • Category : JavaScript Tutorials
  • close (HTML DOM Window)

    <!DOCTYPE html>
    <html>
    <head>
    <title>Js Code Testing</title>
    </head>
    <body>
    <div id = "msg"></div>
    <button onclick = "openWin()">Open Window</button>
    <button onclick = "closeWin()">Close Window</button>
    <button onclick = "chkStatus()">Check Status</button>

    <script>

    var myWin;

    function openWin(){
    myWin = window.open("", "myWin", "width=300px, height=200px");
    }

    function closeWin(){
    if(myWin){
    myWin.close();
    }
    }

    function chkStatus(){
    if(!myWin){
    document.getElementById("msg").innerHTML = "Window…

     
    Web Service & ICT Solutions 25 Jun 2022, 11:35:58
  • Category : JavaScript Tutorials
  • onchange 1 (HTML DOM Events)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <input type = "text" id = "fname" onchange = "jsFun()">
    <script>
    function jsFun(){
    var x = document.getElementById("fname");
    x.value = x.value.toUpperCase();
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 25 Jun 2022, 11:35:20
  • Category : JavaScript Tutorials
  • onchange (HTML DOM Events)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <select id = "myId" onchange = "jsFun()">
    <option value = "#">Choose Options</option>
    <option value = "Thet">Thet</option>
    <option value = "Naing">Naing</option>
    <option value = "Win">Win</option>
    </select>
    <p id = "demo"></p>
    <script>
    function…

     
    Web Service & ICT Solutions 24 Jun 2022, 12:09:13
  • Category : JavaScript Tutorials
  • appendChild() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button onclick = "jsFun()"> + </button>
    <script>
    function jsFun(){
    var para = document.createElement("P");
    var txtNode = document.createTextNode("Paragraph");
    para.appendChild(txtNode);
    document.body.appendChild(para);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 12:08:45
  • Category : JavaScript Tutorials
  • appendChild() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    #myDiv{
    width: 200px;
    border: 2px solid red;
    padding: 5px;
    text-align: center;
    }
    </style>
    </head>
    <body>
    <button onclick = "jsFun()"> + </button>
    <p></p>
    <div id = "myDiv">My Example</div>
    <script>
    function jsFun(){
    var para = document.createElement("P");
    var txtNode = document.createTextNode("Example");
    para.appendChild(txtNode);
    document.getElementById("myDiv").appendChild(para);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 12:08:17
  • Category : JavaScript Tutorials
  • appendChild() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <ul id = "myText">
    <li>Thet</li>
    <li>Naing</li>
    </ul>

    <button onclick = "jsFun()">Try It</button>

    <script>
    function jsFun(){
    var node = document.createElement("LI");
    var txtNode = document.createTextNode("Win");
    node.appendChild(txtNode);
    document.getElementById("myText").appendChild(node);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 12:07:06
  • Category : JavaScript Tutorials
  • addEventListener() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button id = "myId">Try It</button>
    <p id = "demo"></p>
    <script>
    var x = document.getElementById("myId");
    x.addEventListener("mouseover", msOver);
    x.addEventListener("click", msClick);
    x.addEventListener("mouseout", msOut);

    function msOver(){
    document.getElementById("demo").innerHTML += "Mouse Over <br />";
    }

    function msClick(){
    document.getElementById("demo").innerHTML += "Mouse Click <br />";
    }

    function msOut(){
    document.getElementById("demo").innerHTML…

     
    Web Service & ICT Solutions 24 Jun 2022, 12:06:32
  • Category : JavaScript Tutorials
  • addEventListener() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button id = "myId">Try It</button>
    <p id = "demo"></p>
    <script>
    var p1 = 9;
    var p2 = 9;
    document.getElementById("myId").addEventListener("click", function(){myFun(p1, p2)});

    function myFun(num1, num2){
    var x = num1 * num2;
    document.getElementById("demo").innerHTML = x;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 12:05:41
  • Category : JavaScript Tutorials
  • addEventListener() (HTML DOM Elements)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button id = "myId">Try It</button>

    <script>
    var x = document.getElementById("myId");
    x.addEventListener("click", myFun1);
    x.addEventListener("click", myFun2);

    function myFun1(){
    alert("Function1");
    }

    function myFun2(){
    alert("Function2");
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 11:54:00
  • Category : JavaScript Tutorials
  • querySelectorAll() (HTML DOM Document)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <h1 class = "example">Heading</h1>
    <p class = "example">Paragraph</p>
    <button onclick = "jsFun()">Try It</button>
    <script>
    function jsFun(){
    var i;
    var x = document.querySelectorAll(".example");
    for(i = 0; i < x.length; i++){
    x[i].style.color = "red";
    }
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 11:52:53
  • Category : JavaScript Tutorials
  • getElementsByTagName (HTML DOM Document)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    </style>
    </head>
    <body>
    <ol>
    <li>Example_1</li>
    <li>Example_2</li>
    <li>Example_3</li>
    </ol>
    <button onclick = "jsFun()">Red</button>
    <script>
    function jsFun(){
    var i;
    var x = document.getElementsByTagName("LI");
    for(i = 0; i < x.length; i++){
    x[i].style.color = "red";
    }
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 11:51:48
  • Category : JavaScript Tutorials
  • getElementsByClassName (HTML DOM Document)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    .Example{
    border: 2px solid yellow;
    padding: 5px;
    width: 100px;
    }
    </style>
    </head>
    <body>
    <div class = "Example">
    Example_1
    </div>
    <div class = "Example">
    Example_2
    </div>
    <div class = "Example">
    Example_3
    </div><br />

    <button style = "background: red" onclick = "colRed()">Red</button>
    <button style = "background: green"…

     
    Web Service & ICT Solutions 24 Jun 2022, 11:50:34
  • Category : JavaScript Tutorials
  • document.links (HTML DOM Document)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button onclick = "jsGreen()">Green</button>
    <button onclick = "jsRed()">Red</button><br />

    <p id = "demo"></p>

    <li><a href = "tnwict.com">tnwict.com</a></li>
    <li><a href = "tnw87.com">tnw87.com</a></li>
    <li><a href = "tnw87.site">tnw87.site</a></li>

    <script>
    function jsGreen(){
    var i;
    var x = document.links;
    for(i = 0;…

     
    Web Service & ICT Solutions 24 Jun 2022, 11:48:24
  • Category : JavaScript Tutorials
  • Creating Text Node (HTML DOM Document)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    #myDiv{
    border: 1px solid red;
    margin-bottom: 10px;
    }
    </style>
    </head>
    <body>
    <div id = "myDiv">
    This is just Testing.
    </div>
    <button onclick = "jsFun()">+</button>
    <script>
    function jsFun(){
    var para = document.createElement("P");
    para.innerHTML = "Paragraph";
    document.getElementById("myDiv").appendChild(para);
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 24 Jun 2022, 11:41:03
  • Category : JavaScript Tutorials
  • Creating a Calculator with JS

    <html>
    <head>
    <title>Math Fun</title>
    <script>
    function registerEvents(){
    document.mathWiz.operate.addEventListener('click', doTheMath, false);
    }
    function doTheMath(){
    var first = parseInt(document.mathWiz.numberOne.value);
    var second = parseInt(document.mathWiz.numberTwo.value);
    var operator = document.mathWiz.operator.value;

    switch (operator){
    case "add":
    var answer = first + second;
    break;
    case "substract":
    var answer = first - second;
    break;
    case "multiply":
    var answer…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:12:27
  • Category : JavaScript Tutorials
  • JS Timer

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <button onclick = "myTimer = setInterval(jsCount, 1000)">Start Count</button>
    <button onclick = "clearInterval(myTimer)">Stop Count</button>
    <p id = "demo"></p>
    <script>
    c = 0;
    function jsCount(){
    document.getElementById("demo").innerHTML = ++c;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 18:10:53
  • Category : JavaScript Tutorials
  • Creating Readmore Button

    <!DOCTYPE html>
    <html>
    <head>
    <titile>Code Testing For Read More Function</titile>
    <style>
    #more{
    display: none;
    }
    </style>
    </head>
    <body>
    <p>
    I am Thet Naing Win. I am 35 years old man. Now I stay in…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:09:37
  • Category : JavaScript Tutorials
  • Creating Nav Bar

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    body{
    margin: 0px;
    font-size: 14px;
    }

    .header{
    background-color: grey;
    text-align: center;
    padding: 12px;
    }

    #navbar{
    overflow: hidden;
    background-color: black;
    }

    #navbar a{
    display: block;
    float: left;
    padding: 16px 32px;
    text-decoration: none;
    color: white;
    }

    #navbar a:hover{
    background-color: gray;
    }

    #navbar a:focus{
    background-color: green;
    }

    .content{
    padding: 16px;
    line-height: 25px;
    }

    .sticky{
    position: fixed;
    top: 0px;
    width: 100%;
    }

    .sticky + .content{
    padding-top: 60px;
    }


    </style>
    </head>
    <body…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:08:34
  • Category : JavaScript Tutorials
  • Dropdown Menu

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    .dropdown{
    display: inline-block;
    position: relative;
    }

    .dropbtn{
    background-color: red;
    font-size: 14px;
    color: white;
    padding: 12px 32px;
    cursor: pointer;
    border: 2px solid green;
    }

    .dropbtn:hover, .dropbtn:focus{
    background-color: orange;
    }

    .dropcontent{
    display: none;
    overflow: auto;
    position: absolute;
    box-shadow: 0px 2px 1px 3px;
    }

    .dropcontent a{
    display: block;
    color: white;
    padding: 15px 32px;
    text-decoration: none;
    background-color:…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:08:00
  • Category : JavaScript Tutorials
  • Display a Clock

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <script>
    function startTime(){
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    var s = today.getSeconds();
    m = checkTime(m);
    s = checkTime(s);
    document.getElementById("demo").innerHTML = h + ":" + m + ":"…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:06:29
  • Category : JavaScript Tutorials
  • Converting Celsius to Fahrenheit

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <p><input id = "c" onkeyup = "temperature('C')"> degree Celsius.</p>
    <p><input id = "f" onkeyup = "temperature('F')"> degree Fahrenheit.</p>
    <script>
    function temperature(degree){
    var x;
    if(degree == "C"){
    x = document.getElementById("c").value * 9 / 5…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:04:53
  • Category : JavaScript Tutorials
  • Change Background Color of Html Elements

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    </head>
    <body>
    <table style = "width:300px; height:100px">
    <tr>
    <td onmouseover = "bgChange(this.style.backgroundColor)";
    onmouseout = "bgChange('transparent')";
    style = "background-color:red"></td>
    <td onmouseover = "bgChange(this.style.backgroundColor)";
    onmouseout = "bgChange('transparent')";
    style = "background-color:green"></td>
    <td…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:03:21
  • Category : JavaScript Tutorials
  • JS Animation

    <!DOCTYPE html>
    <html>
    <head>
    <title>JS Code Testing</title>
    <style>
    #mySlide{
    position: relative;
    }

    li{
    position: relative;
    list-style: none;
    display: block;
    float: left;
    padding: 0px 10%;
    width: auto;
    }

    @keyframes mymove{
    from { left: 0px; }
    to { left: 100%; }
    }

    @-webkit-keyframes{
    from { left: 0px; }
    to { left: 100%; }
    }
    </style>
    </head>
    <body onload…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:01:59
  • Category : JavaScript Tutorials
  • Switch (JS Statement)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Statement</title>
    </head>
    <body>
    <p id = "demo">What is Today?</p>
    <button type = "button" onclick = "jsFunction()">Click Now</button>
    <script>
    function jsFunction(){
    switch(new Date().getDay()){
    case 0:
    day = "Sunday";
    break;

    case 1:
    day = "Monday";
    break;

    case 2:
    day = "Tuesday";
    break;

    case 3:
    day = "Wednesday";
    break;

    case 4:
    day…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:01:25
  • Category : JavaScript Tutorials
  • If (JS Statement)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Statement</title>
    </head>
    <body>
    <h1>JavaScript Code Testing</h1>
    <p id = "demo1"></p>
    <p id = "demo2"></p>
    <p id = "demo3"></p>
    <button type = "button" onclick = "jsFunction()">Try Now</button>
    <script>
    function jsFunction(){
    var you = "I like to swim.";
    var me =…

     
    Web Service & ICT Solutions 22 Jun 2022, 18:00:50
  • Category : JavaScript Tutorials
  • Continue (JS Statement)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var txt = "", i;
    for(i = 0; i < 10; i++){
    if (i===5){continue;}
    txt += i + "<br />";
    }
    document.getElementById("demo").innerHTML = txt;
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 18:00:18
  • Category : JavaScript Tutorials
  • Break (JS Statement)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var txt = "", i;
    for(i = 0; i < 10; i++){
    if (i===5){break;}
    txt += i + "<br />";
    }
    document.getElementById("demo").innerHTML = txt;
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 17:58:27
  • Category : JavaScript Tutorials
  • Random Integer (JS Random)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">Please click Random for random numbers.</p>
    <button type = "button" onclick = "jsRand()">Random</button>
    <script>
    function jsRand(){
    var rand = Math.floor(Math.random() * 4000);
    document.getElementById("demo").innerHTML = rand;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 17:57:41
  • Category : JavaScript Tutorials
  • Proper Random Function (JS Random)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">Click Random for random numbers.</p>
    <button type = "button" onclick = "myRand()">Random</button>
    <script>

    function myRand(){
    var rand = jsRand(100000, 900000);
    document.getElementById("demo").innerHTML = rand;
    }

    function jsRand(min, max){
    return Math.floor(Math.random() * (max -…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:48:13
  • Category : JavaScript Tutorials
  • Math.sqrt() (JS Math)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">This is JavaScript Math.sqrt Testing</p>
    <button type = "button" onclick = "jsSqrt()">Math Sqrt</button>

    <script>
    var a = 81;
    document.getElementById("demo").innerHTML = a;

    function jsSqrt(){
    var b = Math.sqrt(a);
    document.getElementById("demo").innerHTML = b;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 09:47:21
  • Category : JavaScript Tutorials
  • Math.round() (JS Math)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">This is JavaScript Math.round Testing</p>
    <button type = "button" onclick = "jsRound()">Math Round</button>

    <script>
    var a = 4.576;
    var b = 4.345;
    document.getElementById("demo").innerHTML = a + " and "…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:46:32
  • Category : JavaScript Tutorials
  • Math.random() (JS Math)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">This is JavaScript Math.random Testing</p>
    <button type = "button" onclick = "jsRandom()">Math Random</button>
    <script>
    function jsRandom(){
    var a = Math.random();
    document.getElementById("demo").innerHTML = a;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 09:45:52
  • Category : JavaScript Tutorials
  • Math.pow() (JS Math)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">This is JavaScript Math.pow Testing</p>
    <button type = "button" onclick = "jsPower()">Math Power</button>

    <script>
    var a = 9;
    var b = 5;
    document.getElementById("demo").innerHTML = a + " and "…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:44:51
  • Category : JavaScript Tutorials
  • Math.PI (JS Math)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo1">This is JavaScript Math.PI Testing</p>
    <button type = "button" onclick = "jsPI()">Math PI</button>
    <script>
    function jsPI(){
    var pi = Math.PI;
    document.getElementById("demo1").innerHTML = pi;
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 09:40:14
  • Category : JavaScript Tutorials
  • JS While Loop

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var names = ["Maung Maung", "Aung Aung", "Mya Mya", "Hla Hla"];
    var txt, i = 0;
    txt = "<ol>";
    while(i < names.length){
    txt += "<li>" + names[i] +…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:39:35
  • Category : JavaScript Tutorials
  • forof (JS For Loop)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var names = ["Maung Maung", "Aung Aung", "Mya Mya", "Hla Hla"];
    var txt;

    for(txt of names){
    document.write("<li>" + txt + "</li>");
    }
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 09:39:01
  • Category : JavaScript Tutorials
  • for (JS For Loop)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var names = ["Maung Maung", "Aung Aung", "Mya Mya", "Hla Hla"];
    var i, txt;

    txt = "<ol>";
    for(i=0; i<names.length; i++){
    txt += "<li>" + names[i] + "</li>";
    }
    txt +=…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:37:54
  • Category : JavaScript Tutorials
  • forin (JS For Loop)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var names = ["Maung Maung", "Aung Aung", "Mya Mya", "Hla Hla"];
    var i, txt;

    txt = "<ol>";
    for(i in names){
    txt += "<li>" + names[i] + "</li>";
    }
    txt +=…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:36:53
  • Category : JavaScript Tutorials
  • JS Form Validation

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <script>
    function formValidate(){
    var x = document.forms["myForm"]["fname"].value;
    if(x == ""){
    alert("Must fill out in the form");
    return false;
    }
    }
    </script>
    </body>
    <form action = "formvalidate1.html" method = "POST" onsubmit = "return formValidate()" name = "myForm">
    <input type…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:35:47
  • Category : JavaScript Tutorials
  • Throw Statement (JS Errors)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <input id = "demo" type = "text">
    <button type = "button" onclick = "jsFun()">Check Input</button>
    <p id = "page"></p>
    <script>
    function jsFun(){
    var sms, x;
    sms = document.getElementById("page");
    sms.innerHTML = "";
    x = document.getElementById("demo").value;
    try{
    if(x ==…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:35:11
  • Category : JavaScript Tutorials
  • Finally Statement (JS Errors)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Cdoe Testing</title>
    </head>
    <body>
    <input id = "demo" type = "text">
    <button type = "button" onclick = "jsFun()">Check Input</button>
    <p id = "page"></p>
    <script>
    function jsFun(){
    var sms, x;
    sms = document.getElementById("page");
    sms.innerHTML;
    x = document.getElementById("demo").value;
    try {
    if (x ==…

     
    Web Service & ICT Solutions 22 Jun 2022, 09:33:58
  • Category : JavaScript Tutorials
  • JS Arrow Function

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <button id = "btn1">Try Now</button>
    <p id = "demo1"></p>

    <button id = "btn2">Try Now</button>
    <p id = "demo2"></p>

    <script>
    var test1 = function(){
    document.getElementById("demo1").innerHTML += this;
    }

    //window object calls the function
    window.addEventListener("load", test1);

    //button object calls…

     
    Web Service & ICT Solutions 22 Jun 2022, 08:04:31
  • Category : JavaScript Tutorials
  • Inheritance (JS Classes)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">Inheritance Test</p>
    <script>
    class Car{
    constructor(brand){
    this.carname = brand;
    }
    present(){
    return "I have " + this.carname;
    }
    }

    class Model extends Car{
    constructor(brand, mod){
    super(brand);
    this.model = mod;
    }
    show(){
    return this.present() + " and the model is "…

     
    Web Service & ICT Solutions 22 Jun 2022, 08:03:15
  • Category : JavaScript Tutorials
  • Getter and Setter (JS Classes)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    class Car{
    constructor(brand){
    this.carname = brand;
    }
    get cnam(){
    return this.carname;
    }
    set cnam(x){
    this.carname = x;
    }
    }
    const myCar = new Car["Tesla"];
    document.getElementById("demo").innerHTML = myCar;
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 22 Jun 2022, 08:02:28
  • Category : JavaScript Tutorials
  • Creating Object (JS Classes)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id ="demo"></p>
    <script>
    class Name{
    constructor(Name, City){
    this.name = Name;
    this.city = City;
    }
    }

    var newName = new Name("Thet", "Yangon");
    document.getElementById("demo").innerHTML = newName.name + " stays in " + newName.city + ".";

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

     
    Web Service & ICT Solutions 22 Jun 2022, 08:01:10
  • Category : JavaScript Tutorials
  • Class Methods (JS Classes)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">What is your name and age?</p>
    <button type = "button" onclick = "jsFun()">Check Name and Age</button>
    <script>
    function jsFun(){
    class Name{
    constructor(Name, Year){
    this.name = Name;
    this.year = Year;
    }

    age(){
    const date =…

     
    Web Service & ICT Solutions 21 Jun 2022, 10:22:01
  • Category : JavaScript Tutorials
  • Reduce() (JS Array Iteration)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>

    <button type = "button" onclick = "jsReduce()">Total</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsReset()">Reset</button>

    <script>
    var numbers = [302, 428, 49, 92, 84, 70, 80, 10, 3,…

     
    Web Service & ICT Solutions 21 Jun 2022, 10:21:20
  • Category : JavaScript Tutorials
  • Map() (JS Array Iteration)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "jsDouble()">Double</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsReset()">Reset</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsTriple()">Triple</button>
    <script>
    var numbers = [302, 428, 49,…

     
    Web Service & ICT Solutions 21 Jun 2022, 10:20:42
  • Category : JavaScript Tutorials
  • Foreach() (JS Array Iteration)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var txt = "";
    var numbers = [302, 428, 49, 92, 84, 70, 80, 10, 3, 200];
    var num = numbers.sort(function (a, b){return a - b;});

    txt…

     
    Web Service & ICT Solutions 21 Jun 2022, 10:19:38
  • Category : JavaScript Tutorials
  • Find() (JS Array Iteration)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">Find the first number greater than 20</p>

    <button type = "button" onclick = "jsFind()">Find > 20</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsReset()">Reset</button>

    <script>
    var numbers = [302,…

     
    Web Service & ICT Solutions 21 Jun 2022, 10:18:54
  • Category : JavaScript Tutorials
  • Filter() (JS Array Iteration)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "jsFilter()">Less Than 100</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsReset()">Reset</button>

    <script>
    var numbers = [302, 428, 49, 92, 84, 70, 80,…

     
    Web Service & ICT Solutions 14 Jun 2022, 21:02:50
  • Category : JavaScript Tutorials
  • Sort() and reverse() numerically (JS Array Sort)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">Sort Numberically</p>
    <button type = "button" onclick = "jsSort()">Sort</button>
    <button type = "button" onclick = "jsReverse()">Reverse</button>
    <script>
    var numbers = [400, 40, 20, 200, 93, 49];
    document.getElementById("demo").innerHTML = numbers.join("<br…

     
    Web Service & ICT Solutions 14 Jun 2022, 21:01:00
  • Category : JavaScript Tutorials
  • Sort() and reverse() alphabetically (JS Array Sort)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "jsSort()">Sort</button>&nbsp;&nbsp;
    <button type = "button" onclick = "jsReverse()">Reverse</button>
    <script>
    var cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila", "Bagan"];
    document.getElementById("demo").innerHTML = cities.join(" * ");

    function…

     
    Web Service & ICT Solutions 14 Jun 2022, 20:59:37
  • Category : JavaScript Tutorials
  • Sort number randomly (JS Array Sort)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "jsRandom()">Sort Now</button>
    <script>
    var numbers = [300, 40, 83, 49, 92, 200, 79];
    document.getElementById("demo").innerHTML = numbers.join("<br />");

    function jsRandom(){
    var random = numbers.sort(function(a,…

     
    Web Service & ICT Solutions 14 Jun 2022, 20:58:36
  • Category : JavaScript Tutorials
  • Math.max and Math.min (JS Array Sort)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "findMax()">Find Max</button>
    <button type = "button" onclick = "jsReset()">Reset</button>
    <button type = "button" onclick = "findMin()">Find Min</button>

    <script>
    var numbers = [200,…

     
    Web Service & ICT Solutions 14 Jun 2022, 20:57:29
  • Category : JavaScript Tutorials
  • Find maximum or minimum number (JS Array Sort)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <button type = "button" onclick = "findMax()">Find Max</button>&nbsp;&nbsp;
    <button type = "button" onclick = "numReset()">Reset</button>&nbsp;&nbsp;
    <button type = "button" onclick = "findMin()">Find Min</button>

    <script>
    var numbers = [200,…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:54:27
  • Category : JavaScript Tutorials
  • Array Function

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <button id = "btn1">Try Now</button>
    <p id = "demo1"></p>

    <button id = "btn2">Try Now</button>
    <p id = "demo2"></p>

    <script>
    var test1 = function(){
    document.getElementById("demo1").innerHTML += this;
    }

    //window object calls the function
    window.addEventListener("load", test1);

    //button object calls…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:52:37
  • Category : JavaScript Tutorials
  • Objects (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var myName = {firstName : "Thet", middleName : "Naing", lastName : "Win"};
    document.getElementById("demo").innerHTML = myName.firstName;
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 13 Jun 2022, 19:52:03
  • Category : JavaScript Tutorials
  • Looping Array Element (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    var cities, clen, text, i;
    cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];
    clen = cities.length;
    text = "<ul>";
    for(i=0; i<clen; i++){
    text += "<li>" + cities[i] + "</li>";
    }
    text += "</ul>";
    document.getElementById("demo").innerHTML…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:51:24
  • Category : JavaScript Tutorials
  • Foreach Loop (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">forEach Loop</p>
    <script>
    var cities, text;
    cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];

    text = "<ul>";
    cities.forEach(jsFunction);
    text+= "</ul>";

    function jsFunction(value){
    text += "<li>" + value + "</li>";
    }

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

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

     
    Web Service & ICT Solutions 13 Jun 2022, 19:50:56
  • Category : JavaScript Tutorials
  • Creating the Array (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo1"></p>
    <p id = "demo2"></p>
    <script>

    //good habit in crating array
    var a = ["aaa", "bbb", "ccc", "ddd"];
    document.getElementById("demo1").innerHTML = a;

    //bad habit in creating array
    var b = new Array("aaa",…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:50:22
  • Category : JavaScript Tutorials
  • Array Elements (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo1"></p>
    <p id = "demo2"></p>
    <script>

    var a = ["aaa", "bbb", "ccc", "ddd"];
    a[0] = "eee";
    document.getElementById("demo1").innerHTML = a;


    var b = new Array("aaa", "bbb", "ccc", "ddd");
    document.getElementById("demo2").innerHTML = b[2];
    </script>
    </body>
    </html>

     
    Web Service & ICT Solutions 13 Jun 2022, 19:49:31
  • Category : JavaScript Tutorials
  • Adding Array Element (JS Arrays)

    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Code Testing</title>
    </head>
    <body>
    <p id = "demo">forEach Loop</p>
    <script>
    var cities, text;
    cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];

    text = "<ul>";
    cities.forEach(jsFunction);
    text+= "</ul>";

    function jsFunction(value){
    text += "<li>" + value + "</li>";
    }

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

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

     
    Web Service & ICT Solutions 13 Jun 2022, 19:48:42
  • Category : JavaScript Tutorials
  • unshift (JavaScript Array Method)



    const tnwNames = ["Moe", "Soe", "Noe", "Mya"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNames.join(", ");
    }

    function tnwFun2(){
    document.getElementById("demo").innerHTML =…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:47:15
  • Category : JavaScript Tutorials
  • splice (JavaScript Array Method)




    const tnwNames = ["Hla", "Mya", "Soe", "Moe", "Noe"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNames.join(", ");
    }

    function tnwFun2(){
    document.getElementById("demo").innerHTML…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:46:34
  • Category : JavaScript Tutorials
  • sort (JavaScript Array Method)



    //1. sort alphabetically
    /**
    const countries = ["Myanmar", "Singapore", "Malaysia", "USA", "Thailand", "Vietname"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = countries.join("<br…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:46:00
  • Category : JavaScript Tutorials
  • some (JavaScript Array Method)



    const tnwNums = [20, 39, 48, 58, 68, 70, 85, 90];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNums.join(",…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:45:18
  • Category : JavaScript Tutorials
  • slice (JavaScript Array Method)



    const tnwNums = [20, 29, 30, 39, 40, 47, 50, 70];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNums.join(",…

     
    Web Service & ICT Solutions 13 Jun 2022, 19:44:28
  • Category : JavaScript Tutorials
  • shift (JavaScript Array Method)



    const tnwNums = [20, 30, 40, 50, 60, 70, 90];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNums.join(", ");
    }

    function…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:50:24
  • Category : JavaScript Tutorials
  • reverse (JavaScript Array Method)



    const tnwNums = [20, 30, 40, 50, 60, 70];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNums.join("<br />");
    }

    function tnwFun2(){

     
    Web Service & ICT Solutions 12 Jun 2022, 15:49:51
  • Category : JavaScript Tutorials
  • reduceRight (JavaScript Array Method)



    const tnwNum = [20, 9, 20, 8, 100];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNum.join(", ");
    }

    function tnwFun2(){
    var…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:49:16
  • Category : JavaScript Tutorials
  • reduce (JavaScript Array Method)



    const tnwNum = [70, 30, 20, 10, 7];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNum.join("<br />");
    }

    function tnwFun2(){
    var…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:48:32
  • Category : JavaScript Tutorials
  • push (JavaScript Array Method)



    const tnwNames = ["Soe Soe", "Moe Moe"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNames.join("<br />");
    }

    function tnwFun2(){
    let tnwAdd…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:47:59
  • Category : JavaScript Tutorials
  • pop (JavaScript Array Method)



    const tnwName = ["Hla Hla", "Mya Mya", "Aung Aung", "Maung Maung"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwName.join("<br…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:47:26
  • Category : JavaScript Tutorials
  • map (JavaScript Array Method)



    const tnwNum = [10, 20, 30, 40];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNum.join("<br />");
    }

    /**
    function tnwFun2(){
    let result…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:46:40
  • Category : JavaScript Tutorials
  • lastIndexOf (JavaScript Array Method)



    const tnwText = "Hello, welcome to TNW (Web Service & ICT Solutions)";

    function tnwFun1(){
    document.getElementById("demo").innerHTML =…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:46:04
  • Category : JavaScript Tutorials
  • keys (JavaScript Array Method)



    const tnwNames = ["Hla Hla", "Mya Mya", "Soe Soe", "Moe Moe"];
    let result = "";

    function tnwFun1(){

     
    Web Service & ICT Solutions 12 Jun 2022, 15:44:56
  • Category : JavaScript Tutorials
  • join (JavaScript Array Method)



    const tnwNames = ["Hla Hla", "Mya Mya", "Aung Aung", "Maung Maung"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNames;
    }

    function…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:44:18
  • Category : JavaScript Tutorials
  • isArray (JavaScript Array Method)



    const tnwText = ["Hla Hla", "Mya Mya", "Soe Soe", "Noe Noe"];
    //const tnwText = "I am…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:43:33
  • Category : JavaScript Tutorials
  • indexOf (JavaScript Array Method)



    const tnwText = "Hello Dear All, I am Thet Naing Win. Welcome to TNW (Web…

     
    Web Service & ICT Solutions 12 Jun 2022, 15:42:46
  • Category : JavaScript Tutorials
  • includes (JavaScript Array Method)



    const tnwNames = ["Hla Hla", "Mya Mya", "Soe Soe", "Moe Moe"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwNames.join("<br…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:58:52
  • Category : JavaScript Tutorials
  • from (JavaScript Array Method)



    const myLetter = "ABCDEFGHIJKL";

    function tnwFun1(){
    document.getElementById("demo").innerHTML = myLetter;
    }

    function tnwFun2(){
    const result = Array.from(myLetter);
    document.getElementById("demo").innerHTML =…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:58:18
  • Category : JavaScript Tutorials
  • forEach (JavaScript Array Method)



    const student = ["Aung Aung", "Maung", "Kyaw", "Zaw", "Soe", "Moe"];
    let names = "";
    function tnwFun1(){
    student.forEach(tnwFun2);
    }

    function…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:57:48
  • Category : JavaScript Tutorials
  • findIndex (JavaScript Array Method)



    const tnwAges = [19, 39, 28, 43, 29, 45, 53];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwAges.join("<br />");
    }

    function…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:57:10
  • Category : JavaScript Tutorials
  • find (JavaScript Array Method)



    const tnwAges = [19, 39, 28, 43, 29, 45, 53];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwAges.join("<br />");
    }

    function…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:56:23
  • Category : JavaScript Tutorials
  • filter (JavaScript Array Method)



    const tnwAges = [25, 18, 29, 20, 40, 32, 53, 24];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwAges.join("<br…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:55:54
  • Category : JavaScript Tutorials
  • fill (JavaScript Array Method)



    const tnwNames = ["Aye Aye", "Nwe Nwe", "Hla Hla", "Mya Mya", "Soe Soe", "Moe Moe"];

    function…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:55:16
  • Category : JavaScript Tutorials
  • every (JavaScript Array Method)



    const tnwAge = [20, 29, 48, 76, 50, 38, 39];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = tnwAge.every(tnwFun2);
    }

    function tnwFun2(chkAge){

     
    Web Service & ICT Solutions 11 Jun 2022, 09:53:28
  • Category : JavaScript Tutorials
  • entries (JavaScript Array Method)




    const tnwNames = ["Hla Hla", "Mya Mya", "Aye Aye", "Nwe Nwe", "Soe Soe", "Moe Moe",…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:51:51
  • Category : JavaScript Tutorials
  • copyWithin (JavaScript Array Method)



    const people = ["Hla", "Mya", "Aung", "Maung", "Soe", "Noe", "Moe"];

    function tnwFun1(){
    document.getElementById("demo").innerHTML = people.join("<br />");
    }

    function…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:48:09
  • Category : JavaScript Tutorials
  • concat (JavaScript Array Methods)



    const girls = ["Aye Aye", "Nwe Nwe", "Htwe Htwe"];
    const boys = ["Aung Aung", "Maung Maung",…

     
    Web Service & ICT Solutions 11 Jun 2022, 09:47:07
  • Category : JavaScript Tutorials
  • JavaScript Array Properties



    length
    Sets or returns the number of elements in an array.

    prototype
    Allows you to…

     
    Web Service & ICT Solutions 2022-05-20 22:30:21
  • Category : JavaScript Tutorials
  • JavaScript Array



    /*
    const countries = ["USA", "UK", "Canada"];
    document.write(countries);

    //example one
    const names = ["Hla Hla", "Mya Mya", "Soe Soe"];
    document.write(names);


    //example…

     
    Web Service & ICT Solutions 2021-05-17 09:50:04
  • Category : JavaScript Tutorials
  • JavaScript Course

    Chapter 1: Introduction to JavaScript
        - What is JavaScript
        - History of JavaScript
        - Start writing JS Codes
        - JavaScript Outputs
        - JavaScript Syntax
      …

     
    Web Service & ICT Solutions 2020-04-28 11:19:54
  • Category : JavaScript Tutorials
  • JavaScript Constant



    Example 1

    <html>
    <head>
    <title>JS Constant</title>
    </head>
    <body>
    <p id = "demo"></p>
    <script>
    const x = (x, y) => x * y;
    document.getElementById("demo").innerHTML =…

     
    Web Service & ICT Solutions 2020-04-28 11:00:06
  • Category : JavaScript Tutorials
  • JavaScript Variable Naming



    /*
    //the first character is letter
    var myName = "I am Thet Naing Win.";
    document.write(myName);

    //the first character is…

     
    Web Service & ICT Solutions 2020-04-26 12:50:48
  • Category : JavaScript Tutorials
  • JavaScript Variables



    /*var a = "I am Thet Naing Win.";
    let b = "I am from Myanmar.";
    const c…

     
    Web Service & ICT Solutions 2020-04-26 12:35:22
  • Category : JavaScript Tutorials
  • Basic JavaScript Objects



    /*var person = {
    firstname : "Thet",
    lastname : "Naing"
    };

    function tnwFun(){
    document.getElementById("demo").innerHTML = person.lastname;
    }*/

    var person…

     
    Web Service & ICT Solutions 2020-04-25 17:07:27
  • Category : JavaScript Tutorials
  • JavaScript Statements



    var a = "I am Thet Naing Win."; // Statement one
    var b = "I am…

     
    Web Service & ICT Solutions 2020-04-25 16:25:38
  • Category : JavaScript Tutorials
  • JavaScript Bracket Notation



    var myObj = {tree: 'green', sky: 'blue', cloud: 'white'};

    myObj['sky'] = 'gray'; //here i…

     
    Web Service & ICT Solutions 2020-04-25 16:13:20
  • Category : JavaScript Tutorials
  • JavaScript Dot Notation



    var myObj = {tree : "green", sky : "blue", cloud : "white"};

    myObj.cloud = "gray";

    var myColor…

     
    Web Service & ICT Solutions 2020-04-24 17:04:37
  • Category : JavaScript Tutorials
  • Accessing Elements



    // 1. Access Element By Id
    /*
    function tnwFun(){
    var txt = "<b>Welcome to TNW(Web Service &…

     
    Web Service & ICT Solutions 2020-03-22 16:07:29
  • Category : JavaScript Tutorials
  • JavaScript Basic Rules



    // 1. JavaScript is case-sensitive

    /*
    var myTest = "I am Thet Naing Win";
    var mytest = "Who…

     
    Web Service & ICT Solutions 2020-03-20 16:20:00
  • Category : JavaScript Tutorials
  • JavaScript Syntax



    //There is a difference between const and let & var.
    //We can not use const like…

     
    Web Service & ICT Solutions 2020-03-19 16:20:00
  • Category : JavaScript Tutorials
  • JavaScript Outputs


    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript OutPut</title>
    </head>
    <body>
    <p>alert</p>
    <button type = "button" onclick = "jsAlert()">Try Now</button>

    <p>console.log</p>
    <button type = "button" onclick =…

     
    Web Service & ICT Solutions 2020-03-11 16:04:19
  • Category : JavaScript Tutorials
  • Start writing JS codes



    Adding script between <head> and </head>

    <html>
    <head>
    <title>TNW (Web Service & ICT Solutions)</title>
    <script>
    var…

  • About Me
  • Blog and Ambitions
  • Terms and Conditions
  • Contact Me
  • Service and Guarantee
  • Customers and News
  • Carrers