Tutorial by Examples

Setting only one style: $('#target-element').css('color', '#000000'); Setting multiple styles at the same time: $('#target-element').css({ 'color': '#000000', 'font-size': '12pt', 'float': 'left', });
To get an element's CSS property you can use the .css(propertyName) method: var color = $('#element').css('color'); var fontSize = $('#element').css('font-size');
From JavaDoc The Theories runner allows to test a certain functionality against a subset of an infinite set of data points. Running theories import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; @RunWith(Theories...
A deadlock occurs when two competing actions wait for the other to finish, and thus neither ever does. In java there is one lock associated with each object. To avoid concurrent modification done by multiple threads on single object we can use synchronized keyword, but everything comes at a cost....
Although modules are ideal, if the library you are using is referenced by a global variable (like $ or _), because it was loaded by a script tag, you can create an ambient declaration in order to refer to it: declare const _: any;
Once you have Sails installed, just type $ sails new <project_name> This will create a skeleton Sails project in a new folder called <project_name>. You can also create a new project in an empty folder by typing $ sails new
A message with important, and usually time-sensitive, information. <div role="alert" aria-live="assertive">Your session will expire in 60 seconds.</div> Note that I've included both role="alert" and aria-live="assertive" at the same time. The...
A type of dialog that contains an alert message, where initial focus goes to an element within the dialog. <div role="alertdialog"> <h1>Warning</h1> <div role="alert">Your session will expire in 60 seconds.</div> </div>
A region declared as a web application, as opposed to a web document. In this example, the application is a simple calculator that might add two numbers together. <div role="application"> <h1>Calculator</h1> <input id="num1" type="text"> +...
A section of a page that consists of a composition that forms an independent part of a document, page, or site. Setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and is not recommended as these properties are already set by the browser....
A region that contains mostly site-oriented content, rather than page-specific content. <div role="banner"> <h1>My Site</h1> <ul> <li><a href="/">Home</a></li> <li><a href="/about">About</...
An input that allows for user-triggered actions when clicked or pressed. <button role="button">Add</button>
A cell in a tabular container. <table> <thead> <!-- etc --> </thead> <tbody> <td role="cell">95</td> <td role="cell">14</td> <td role="cell">25</td> </tbody> </t...
A checkable input that has three possible values: true, false, or mixed. <p> <input type="checkbox" role="checkbox" aria-checked="false"> I agree to the terms </p>
A cell containing header information for a column. <table role="grid"> <thead> <tr> <th role="columnheader">Day 1</th> <th role="columnheader">Day 2</th> <th role="columnheader">Day ...
A presentation of a select; usually similar to a textbox where users can type ahead to select an option, or type to enter arbitrary text as a new item in the list. <input type="text" role="combobox" aria-expanded="false"> Typically, you would use JavaScript to...
A supporting section of the document, designed to be complementary to the main content at a similar level in the DOM hierarchy, but remains meaningful when separated from the main content. <div role="complementary"> <h2>More Articles</h2> <ul> <!-- ...
A large perceivable region that contains information about the parent document. <p role="contentinfo"> Author: Albert Einstein<br> Published: August 15, 1940 </p>
A definition of a term or concept. <span role="term" aria-labelledby="def1">Love</span> <span id="def1" role="definition">an intense feeling of deep affection.</span>
A dialog is an application window that is designed to interrupt the current processing of an application in order to prompt the user to enter information or require a response. <div role="dialog"> <p>Are you sure?</p> <button role="button">Yes</b...

Page 347 of 1336