The most viewed items
/*var a = "I am Thet Naing Win.";
let b = "I am from Myanmar.";
const c = "I currently stay in Yangon.";
document.write(a);
document.write(b);
document.write(c);
const a = "I am Thet Naing Win.";
const a = "Who are you?";
document.write(a);
*/
var tnwGlobal = "I am TNW Global."; // global variable
function tnwOne(){
var tnwLocal = "I am TNW Local."; //local variable
document.getElementById("global").innerHTML = tnwGlobal;
document.getElementById("local").innerHTML = tnwLocal;
}
function tnwTwo(){
document.getElementById("global").innerHTML = tnwGlobal;
document.getElementById("local").innerHTML = tnwLocal; //local variable declared in tnwOne
}
/*var person = {
firstname : "Thet",
lastname : "Naing"
};
function tnwFun(){
document.getElementById("demo").innerHTML = person.lastname;
}*/
var person = {
firstname : "Thet",
lastname : "Naing",
fullname : function(){
return person.firstname+ " " +person.lastname;
}
}
function tnwFun(){
document.getElementById("demo").innerHTML = person.fullname();
}
var a = "I am Thet Naing Win."; // Statement one
var b = "I am from Myanmar."; // Statement two
var c = "I currently stay in Yangon."; // Statement three
/*
document.write(a);
document.write(b);
document.write(c);*/
function tnwFun(){
document.getElementById("demo1").innerHTML = a;
document.getElementById("demo2").innerHTML = b;
document.getElementById("demo3").innerHTML = c;
}
var myObj = {tree: 'green', sky: 'blue', cloud: 'white'};
myObj['sky'] = 'gray'; //here i use ctrl+s to save
var myColor = myObj['sky']; //bracket notation
document.write(myColor);
var myObj = {tree : "green", sky : "blue", cloud : "white"};
myObj.cloud = "gray";
var myColor = myObj.cloud;
document.write(myColor);
// 1. Access Element By Id
/*
function tnwFun(){
var txt = "<b>Welcome to TNW(Web Service & ICT Solutions)</b><br /><br />TNW Provides The Best ICT Solutions For Your Business By The Reasonable Price.";
document.getElementById("tnwId").innerHTML = txt;
}*/
// 2. Access Elements By ClassName
/*
function tnwBlue(){
var i;
var x = document.getElementsByClassName("tnwPage");
for(i = 0; i < x.length; i++){
x[i].style.backgroundColor = "blue";
x[i].style.color = "white";
}
}
function tnwRed(){
var i;
var x = document.getElementsByClassName("tnwPage");
for(i = 0; i < x.length; i++){
x[i].style.backgroundColor = "red";
x[i].style.color = "white";
}
} */
// 3. Access Elements By Name
/*
function tnwBlue(){
var i;
var x = document.getElementsByName("tnwName");
for(i = 0; i < x.length; i++){
x[i].style.backgroundColor = "blue";
x[i].style.color = "white";
}
}
function tnwRed(){
var i;
var x = document.getElementsByName("tnwName");
for(i = 0; i < x.length; i++){
x[i].style.backgroundColor = "red";
x[i].style.color = "white";
}
} */
// 4. Access Elements By tagName
/*
function tnwFun(){
var i;
var x = document.getElementsByTagName("li");
for(i = 0; i < x.length; i++){
x[i].style.color = "red";
}
}*/
// 5. Access Element By CSS Selector
function tnwFun(){
var i;
var x = document.querySelectorAll(".tnwClass");
for (i = 0; i < x.length; i++){
x[i].style.color = "red";
}
}
// 1. JavaScript is case-sensitive
/*
var myTest = "I am Thet Naing Win";
var mytest = "Who are you?"
document.write(mytest);
*/
// 2. All the statements should end in semicolon
/*
var myStatement1 = "I am Thet Naing Win.";
var myStatement2 = "I am from Myanmar.";
var myStatement3 = "I live in Yangon now.";
var myStatement4 = "I am 35 now.";
document.write(myStatement1 + " " + myStatement2 + " " + myStatement3 + " " + myStatement4);
*/
// 3. All the variables mu be defined before using it. The type of data is put into the variables.
/*
var myVar1 = "I am Thet Naing Win."; //String
var myVar2 = "I am 35 now."; //number
document.write(myVar1 + " " + myVar2);
*/
// Global variable and local variable
/*
var tnwGlobal = "I am TNW Global."; //global variable
function myFun1(){
var tnwLocal1 = "I am TNW Local one."; //local variable
document.write(tnwGlobal + "<br />" + tnwLocal1);
}
function myFun2(){
var tnwLocal2 = "I am TNW Local two."; //local variable
document.write(tnwGlobal + "<br />" + tnwLocal2 + "<br />" + tnwLocal1);
}
*/
//Function two does not work as the local variable from myFun1() is being used in myFun2().
// 4. We can use single quotation mark or double quotation mark to declare the strings
/*
var myString1 = "I am Thet Naing Win.";//double quotation mark
var myString2 = 'I am from Myanmar.';//single quotation mark
document.write(myString1 + "<br />" + myString2);
*/
// 5. Varialbe increment or decrement
/*
var a;
a = a + 1; //or
a++;
a = a - 1; //or
a--;
*/
// For example
/*
for(var a = 9; a >= 1; a--){
document.write(a + "<br />");
}
*/
// 6. Comments
// We can use // or /* ------- */
//There is a difference between const and let & var.
//We can not use const like let and var.
//For example
const a = 9;
const b = 8;
const c = a * b;
document.write(c);
//we must use const keyword like this
Please look at the following video.
<!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 = "jsConsole()">Try Now</button>
<p>document.write</p>
<button type = "button" onclick = "jsWrite()">Try Now</button>
<p id = "demo">innerHTML</p>
<button type = "button" onclick = "jsInner()">Try Now</button>
<p>Window Print</p>
<button type = "button" onclick = "jsPrint()">Print Now</button>
<script>
function jsAlert(){
alert("Window Alert in JavaScript OutPut");
}
function jsConsole(){
console.log("Console Log in JavaScript OutPut");
}
function jsWrite(){
document.write("document.write in JavaScript OutPut");
}
function jsInner(){
document.getElementById("demo").innerHTML = "inner.html in JavaScript OutPut";
}
function jsPrint(){
window.print("Window Print in JavaScript OutPut");
}
</script>
</body>
</html>
Adding script between <head> and </head>
<html>
<head>
<title>TNW (Web Service & ICT Solutions)</title>
<script>
var txt = "<b>Welcome to TNW (Web Service & ICT Solutions)!</b><br /><br /> TNW provides the best ICT Solutions for your business by the reasonable price.";
function myFun(){
document.getElementById("demo").innerHTML = txt;
}
</script>
</head>
<body>
<p id = "demo">TNW</p>
<button type = "button" onclick = "myFun()">Click Here</button>
</body>
</html>
Open notepad or text editor and write the above codes. Then, save it as test.html and try to open by one of the browsers on your computer.
Adding Script between <body> and </body>
<html>
<head>
<title>TNW (Web Service & ICT Solutions)</title>
</head>
<body>
<p id = "demo">TNW</p>
<button type = "button" onclick = "myFun()">Click Here</button>
<script>
var txt = "<b>Welcome to TNW (Web Service & ICT Solutions)!</b><br /><br /> TNW provides the best ICT Solutions for your business by the reasonable price.";
function myFun(){
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>
Open notepad or text editor and write the above codes. Then, save it as test.html and try to open by one of the browsers on your computer.
If you are finding the SEO tools to get more traffic in your website, I would like to suggest you to try and use SEMrush. It is one of the best SEO tools. If you want to know more details, please click here.
Google Search Console is one of the best free SEO tools for your website. There are so many features we can do in it such as Performance, URL Inspection, Coverage and Sitemap.
How to add your website Google Search Console
1. Firstly click here to enter Google Search Console.
2. Click Start now and type your domain or your URL and click continue.
3. Follow the instructions to verify ownership. There are so many ways we can choose to verify ownership.
Performance
After your website has been successfully added to Google Search Console, visitors can see your website in Google and you can check how many clicks and impressions you have got daily or weekly or monthly. You can also check which key word was used by the visitors to get your website. You can also check Pages, Countries and Devices.
Coverage
We can check which pages have what kinds of errors.
Sitemap
We can submit the sitemaps in the Google Search Console. We can write the codes ourselves or can use other third party websites to create sitemaps.
To use third party website, please click here. After creating sitemap, download it and upload to your hosting or server. After uploading, type the URL under Add a new sitemap and click submit.
Links
We can check External links, Internal links, Top linking sites and Top linking text.
(note: if you have something difficulty in using Google Search Console, please do not hesitate to contact me).
Thank you all.