Skip to content

18.07.30

chy edited this page Jul 31, 2018 · 1 revision
[Js] Closure
var closure = (function(){
    var _name = '';
    var getName = function() {
        return _name;
    }
    var setName = function(name) {
        _name = name
    }
    return {
        getName: getName,
        setName: setName
    }
})();
[JQuery] value selector
$('[attribute|="@"]'); // has prefix @, delimeted by '-'
// '@aa' -> (x), '@' -> (o), '@-aa' -> (o);

$('[attribute*="@"]'); // contains @

$('[attribute~="@"]'); // contains word @, delimeted by space

$('[attribute$="@"]'); // end with @

$('[attribute="@"]'); // equal with @

$('[attribute!="@"]'); // not equal with @

$('[attribute^="@"]'); // start with @

$('[attribute]'); // has attribute

$('[attribute1="@"][attribute2="!"]'); // multiple attribute selector

Clone this wiki locally