$.fn.plainText = function() {
var str = '';
this.contents().each(function() {
if (this.nodeType == 3) {
str += this.textContent || this.innerText || '';
}
});
return str.trim();
};
var output = $('div').plainText();
console.log(output); // return Тест тест тест
$(document).ready(function() {
$(".sidebar-tabs__item a").click(function(event) {
event.preventDefault();
// ============================= updated ======================
$('.sidebar-tabs__item_active').removeClass("sidebar-tabs__item_active");
$(this).addClass("sidebar-tabs__item_active");
// ============================= /updated =====================
var tab = $(this).attr("href");
$(".sidebar-tabs__content").not(tab).css("display", "none");
$(tab).fadeIn();
});
});
$('.views-field-field-jtc-top .field-content').each(function() {
var $this = $(this),
_index = parseInt($this.val()) - 1,
_classes = ['first-rating', 'second-rating', 'third-rating'];
//console.log (_classes[_index]);
if (_classes[_index]) {
$this.addClass(_classes[_index]);
} else {
$this.addClass('other-rating');
}
});