<script>
document.addEventListener("DOMContentLoaded", function(){
(function () {
let beforeTxt = 'Подробнее';
let afterTxt = 'Скрыть';
let t530__text = document.querySelectorAll('.t530__text');
let element = document.createElement("div");
element.className = "t530__btn";
for (let i = 0; i < t530__text.length; i++) {
let element = document.createElement("div");
element.innerText = beforeTxt;
element.className = "t530__btn t-text t-name_xs";
t530__text[i].insertAdjacentElement('afterEnd', element);
};
let t530__btn = document.querySelectorAll('.t530__btn');
for (let i = 0; i < t530__btn.length; i++) {
t530__btn[i].addEventListener('click', function() {
let hideText = this.previousElementSibling;
hideText.classList.toggle('show-txt');
this.innerText = (this.innerText === beforeTxt) ? this.innerText = afterTxt : this.innerText = beforeTxt;
});
};
})();
});
</script>
<style>
.t530__descr {
color: #000;
margin-top: 10px;
}
.t530__text , .t530__descr{ font-size: 15px}
.t530__text {display: none}
.t530__text.show-txt{ display: block}
.t530__text { margin-top: 0}
.t530__btn {
margin-top: 10px;
text-decoration: underline;
cursor: pointer;
}
@media screen and (max-width: 1200px){
.t530__text , .t530__descr{ font-size: 14px}
}
@media screen and (max-width: 640px){
.t530__text , .t530__descr{font-size: 12px}
}
</style>