Answer the question
In order to leave comments, you need to log in
Moving an element in pure javascript?
Good evening. Help me to understand. There are comments in the form of a list that are displayed like this
<li id="comment-23" level="2" class="comment-1">
<ul class="children children-23">
<span></span>
</ul>
</li>
<li id="comment-24" level="2" class="comment-23">
<ul class="children children-24">
<span></span>
</ul>
</li>
<li id="comment-23" level="2" class="comment-1">
<ul class="children children-23">
<span></span>
<li id="comment-24" level="2" class="comment-23">
<ul class="children children-24">
<span></span>
</ul>
</li>
</ul>
</li>
$('#comments-list > .commentlist > li').each(function () {
var parentClass = '.' + $(this).attr('class'),
parent = '#' + $(this).attr('class')+'>'+'ul'+'>'+'span';
$(parentClass).insertAfter(parent)
})
var array = document.querySelectorAll('#comments-list > .commentlist > li');
array.forEach(function (e) {
var parentClass = '.' + e.getAttribute('class');
var parent = '#' + e.getAttribute('class') + '>' + 'ul' + '>' + 'span';
parentElem = document.querySelectorAll(parent);
elem = document.querySelectorAll(parentClass);
});
Answer the question
In order to leave comments, you need to log in
Why update? Just install the new version and change the site config in nginx
sudo update-alternatives --set php /usr/bin/php7.2
sudo update-alternatives --set phar /usr/bin/phar7.2
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2
sudo update-alternatives --set phpize /usr/bin/phpize7.2
sudo update-alternatives --set php-config /usr/bin/php-config7.2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question