0
$(".group.select").not(".select-group").each(function () {
.....
});

Как написать такое же на JavaScript?

1
  • не совсем понятен вопрос. На нативном JS? 11 июн 2019 в 8:46

1 ответ 1

0

Например используя querySelectorAll

 var element = document.querySelectorAll('.group .select:not(.select-group)');

element.forEach(function(element) {
  console.log(element);
});
body{font-family:tahoma;font-size:12px}
.group {max-width:600px;background:#eee;padding:15px}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="group">
<input type="checkbox" class="select" />check
<input type="checkbox" class="select" />check
<input type="checkbox" class="select" />check

<input type="checkbox" class="select select-group" />select-group
<input type="checkbox" class="select select-group" />select-group
<input type="checkbox" class="select select-group" />select-group
</div>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.