This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
var el = $('.example'); | |
el.addClass('className'); | |
//native Js | |
var el = document.querySelector('.example'); | |
el.classList.add('className'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
var el = $('.example'); | |
el.removeClass('className'); | |
//native Js | |
var el = document.querySelector('.example'); | |
el.classList.remove('className'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
var el = $('.example'); | |
el.toggleClass('className'); | |
//native Js | |
var el = document.querySelector('.example'); | |
el.classList.toggle('className'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
var el = $('.example'); | |
el.hasClass('className'); | |
//native Js | |
var el = document.querySelector('.example'); | |
el.classList.contains('className'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valami: { | |
if (countrySelect.val() != '' && addressInput.val() != '') { | |
if (Number(addressInput.val()) && countrySelect.val() == 'Deutschland') { | |
for (var i = 0; i < merchants.length; i++) { | |
var merchant = merchants[i]; | |
var mz = merchant.zip_code.toString(); | |
var aiv = addressInput.val().toString(); | |
if (mz.indexOf(aiv) == 0 && merchant.fullCountryName == 'Deutschland') { | |
address_string = merchant.zip_code + ' ' + merchant.city; | |
console.log(merchant.zip_code + ' ' + merchant.city); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add = function(x) { | |
return function(y) { | |
return x + y; | |
}; | |
}; | |
var increment = add(1); | |
var addTen = add(10); | |
increment(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
$('.class-name'); | |
//Javascript | |
document.querySelectorAll('.class-name'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQuery | |
$('.class-name-one', '.class-name-two'); | |
//Javascript | |
document.querySelectorAll('.class-name-1, .class-name-2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var el = document.querySelector('.element'); | |
//előző elem -> textnode-al térhet vissza! | |
var prevEl = el.previousSibling; | |
//előző elem meglepetések nélkül | |
var prevEl = el.previousElementSibling; | |
//előző elem -> textnode-al térhet vissza! | |
var nextEl = el.nextSibling; | |
//következő elem meglepetések nélkül | |
var nextEl = el.nextElementSibling; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//elemek kiválasztása | |
var el = querySelectorAll('.elements'); | |
//első elem | |
var firstEl = el[0]; | |
//utolsó elem | |
var lastEl = el[el.length - 1] |
OlderNewer