Common HTML controls and daily widget examples demonstrate how to use and style common controls: buttons, check boxes, file upload, progress, range/slider, single choice button, selection, and text control. For more information, see: • Quick Start: Adding HTML controls and processing events • Encoding Basic applications. Program • Quick Start: Add JavaScript controls and styles in the Windows library • Quick Start: Adjust the style of controls • the example of a control list is written in HTML, CSS, and JavaScript. For the XAML version, see the basic XAML control example. ( Function (){
"Use strict ";
VaR Page = winjs. UI. pages. Define ("/html/button.html ",{
Ready: Function (Element, options ){
// Check which stylesheet is currently loaded
// UI-light by default
If (Document. stylesheets [3]. Disabled = True ){
Document. getelementbyid ("darkstyle"). Checked = False ;
Document. getelementbyid ("lightstyle"). Checked = True ;
} Else If (Document. stylesheets [0]. Disabled = True ){
Document. getelementbyid ("darkstyle"). Checked = True ;
Document. getelementbyid ("lightstyle"). Checked = False ;
}
}
});
})();
FunctionSendmessage (){
VaRData = Document. getelementbyid ("message"). value;
//Put your code here to send out message. Recommend Using ajax to avoid page switch.
Document. getelementbyid ("sendmessageresult"). innertext = "Your message has been sent:" + data;
}
FunctionCalculate1plus1 (){
VaRResult = 1 + 1;
Document. getelementbyid ("calculate1plus1result"). innertext = "The result is" + Result + ".";
}
Complete example: // files/risk/windows8/example of HTML control and routine parts sample.rar