var obj1 = document.getElementById('test1');
console.log( window.getComputedStyle(obj1, null).getPropertyValue("display") );
.parent .block:nth-child(2) ~ .block{
display: none
}
.parent.active .block:nth-child(2) ~ .block{
display: block
}
// jQuery
$('.button').on('click', function(){
$('.parent').addClass('active');
});
// или не jQuery
document.querySelector('.button').addEventListener('click', function(){
document.querySelector('.parent').classList.add('active');
});
// я не сумасшедший.
document.querySelectorAll('.str_item[id$="_' + 34 + '"]').forEach(function(item){
console.log(item);
});
$(function(){
$(document).on('click', '.euro, .tenge, .usd', function(e){
e.preventDefault();
var that = $(this);
var dataSelector = 'data-' + $(this).text().toLowerCase();
$('.priceNum').each(function(idx, elm){
$(elm).html($(elm).attr(dataSelector) + ' <div class="cenov">' + that.text() + '</div>')
});
});
})
var sumContainer = document.querySelector('#summ');
sumContainer.setAttribute('data-original-price', sumContainer.textContent); // Сохраняем оригинальную цену в аттрибут
document.querySelector('#kup').addEventListener('input', function(){
if(this.value.toLowerCase() == 'kupon'){
sumContainer.textContent = sumContainer.textContent * 1 - 150
} else {
sumContainer.textContent = sumContainer.getAttribute('data-original-price')
}
})
$(".btn-order-block ").click(function(){
$(this).parents('.task-block').next('.bet-block').slideToggle(300);
return false;
});
<router-view :key="this.$route.name"></router-view>
$('.data-for-post').on('keyup', get_preview);
window.onload = function(){
document.querySelector('.youtube_block button').addEventListener('click', () => {
document.querySelector('.youtube_block').classList.add('hide_youtube_block')
})
}
<style>
.projects__cards{
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-wrap: wrap;
flex-direction: column-reverse;
}
.projects__card-7:hover + svg path{
display: block !important;
}
</style>
<div class="col-12 projects__cards">
<div class="projects__card text-center projects__card-7">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam amet sapiente distinctio, temporibus tenetur sint, blanditiis non ipsam minima maiores, ipsum illum molestias, deleniti rerum qui! Autem, sed quasi culpa.</div>
<svg class="projects-paths" width="740" height="405" viewBox="0 0 740 405" fill="red" xmlns="http://www.w3.org/2000/svg">
<path style="display: none;" d="M 213.1,6.7c -32.4-14.4-73.7,0-88.1,30.6C 110.6,4.9,67.5-9.5,36.9,6.7C 2.8,22.9-13.4,62.4,13.5,110.9C 33.3,145.1,67.5,170.3,125,217c 59.3-46.7,93.5-71.9,111.5-106.1C 263.4,64.2,247.2,22.9,213.1,6.7z" /></svg>
</div>