HTML: Hypertext Markup Language
CSS: Structured cascading styles
selector {
Property Name: property value;
}
javascript: Interaction/Effects
On-Machine Exercise 1
vararray=["America", "Greece", "Britain", "Canada", "China", "Egypt";
var count=0;
for (var i in array) {
if (Array[i].indexof ("a") >-1| | Array[i].indexof ("A") >-1) {
count++;
}
}
document.write ("The characters containing A or a are:" +count);
On-Machine Exercise 3
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Greet by Time </title>
<script type= "Text/javascript" >
function Jisuan () {
var op1=prompt (' Please enter the first number: ');
var op2=prompt (' Please enter a second number: ');
var pex=prompt (' Please enter operation symbol: ');
Op1=parseint (OP1);//String converted to an integer
Op2=parseint (OP2);
Switch (PEX) {
Case ' + ':
Alert ("Two number operation result:" +op1+pex+op2+ "=" + (OP1+OP2) ");
Break
Case '-':
Alert ("Two number operation result:" +op1+pex+op2+ "=" + (OP1-OP2) ");
Break
Case ' * ':
Alert ("Two number operation result:" +op1+pex+op2+ "=" + (OP1*OP2) ");
Break
Case '/':
Alert ("Two number operation result:" +op1+pex+op2+ "=" + (OP1/OP2) ");
Break
Case '% ':
Alert ("Two number operation result:" +op1+pex+op2+ "=" + (OP1%OP2) ");
Break
}
}
</script>
<body>
<input type= "button" value= "calculates the result of two number operation" onclick= "Jisuan ()"/>
</body>
The base base of JavaScript (core syntax, debugging, Functions,)