Home > front end >  Beginners learning javascript small example
Beginners learning javascript small example

Time:10-04




<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;
Javascript
<style type="text/CSS" & gt;
# text {
Width: 600 px;
Height: 400 px;
Border: # 333 solid 1 px;
Margin - left: 450 px
}

# con {
text-align: center;
Color: red
}

# but {
Width: 600 px;
Height: 30 px;
Border: # 333 solid 1 px;
Margin - left: 450 px
}
</style>
//change the color
The function changeColor () {
Document. GetElementById (" text "). The style, color="red";
}
//change size
The function changeSmallOrLittle () {
Document. The getElementById (" text "). Style. The width="400 px";
Document. The getElementById (" text "). Style, height="250 px";
Document. The getElementById (" but ".) style. The width="400 px";
}
//hide content
The function hide () {
Document. The getElementById (" text ") style. The display="none";

}
//display content
The function display () {
Document. The getElementById (" text ") style. The display="block";

}

//recovery interface
The function rep () {
Var conf=confirm (" do you want to restore Settings?" )
Var execute=prompt (" please input the immediate execution ", "immediately");
If (the execute=="executed immediately") {
Document. The getElementById (" text "). RemoveAttribute (" style ");
}
If (the execute==null) {
Alert (" please input the immediate execution ");
}
}
</script>

<body>

1. Introduction to JavaScript, let you don't understand, JS, quickly understand JS, & lt;/p>

2. JavaScript into order, let you should know the basic grammar of JS, function, array of events, the built-in objects, BOM browser, DOM manipulation, & lt;/p>

3.
Learned after class basis of the above two doors in the in-depth study of JavaScript variable scope, events, objects, motion, cookie, regular expressions, ajax and other courses, & lt;/p>






CodePudding user response:

CodePudding user response:

Thank you, visit

CodePudding user response:

Learning how to learn

CodePudding user response:

  • Related