Home > Web Front-end > JS Tutorial > body text

An in-depth analysis of the enumeration function in JavaScript_javascript skills

WBOY
Release: 2016-05-16 16:56:57
Original
1167 people have browsed it

Thanks to the significant extension of the Microsoft AJAX Library for JavaScript,

Of course the commonly used function of enumeration has also been added,

This time we are going to discuss the enumeration function of JavaScript.

Since the example is very simple,

So just look at the HTML tags directly

Copy the code The code is as follows:

< ;html xmlns="http://www.w3.org/1999/xhtml">


< ;/head>


🎜>
                                                                                                                                                                 ) {


}
BaoBeiMe.EnumDepartment.prototype = {
One: "Information Department",

Two: "Business Department",

Three: "Finance Department",
Four: " R&D Department"
}
BaoBeiMe.EnumDepartment.registerEnum("BaoBeiMe.EnumDepartment");

function Button1_onclick() {
var enumDepartment = new BaoBeiMe.EnumDepartment();
var lblMsg = $get('<%=lblMsg.ClientID %>');

lblMsg.innerText = "One is " enumDepartment.One " , " "

" "Two is " enumDepartment.Two " , " ree is " enumDepartment.Three " , " "
" "Four is " enumDepartment.Four " ";
       }




                onclick="return Button1_onclick()" />
">





Results



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template