var el = event.target || event.srcElement
var $el = $( event.target );
var $html = $("<div></div>")
.html('<div class="one">один</div> \
<div class="two">два</div> \
<div class="three">три</div>');
$html
.find(".two")
.remove();
$html
.appendTo("body");
// or
var $elements = $('<div class="one">один</div><div class="two">два</div><div class="three">три</div>')
, $length = $elements.length
, i = 0
, res = [];
for( ; i < $length; i++ ) {
var el = $elements[i];
if( el.className === "two" ) continue;
res.push(el);
};
$("body").append(res);
function getForFunction(obj, callback) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
callback(obj[key]);
}
}
}
getForFunction({a: 1, b: 2, c: 3}, function( i ){
console.log(i);
});
function handleChange( ctx ) {
var el = ctx.previousElementSibling;
if( ctx.checked && el.nodeName.toLowerCase() === "input" ){
el.style.display = 'inline';
el.value = 1;
el.focus();
} else {
el.style.display = 'none';
}
};