G
G
Georgy Golubev2015-09-03 00:01:24
Layout
Georgy Golubev, 2015-09-03 00:01:24

How to exclude nested div from parent in JavaScript?

There is an assignment of the format value. It is necessary to exclude all divs of the class from here, for example .main-left. I tried this option: and this option: but nothing happened. The essence of the situation is this - there is a JS script that scales the page content depending on the screen size. But I need to throw out some elements so that this scaling does not apply to them. At the same time, in terms of layout, they are nested to the parent div, which initially hooks the script. Could this be the problem?
cont = $('.main')


cont = $('.main:not(.main-left)')

cont = $('.main:not(:has(.main-left))')

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Osher, 2015-09-03
@miraage

$('.main').find('.main-left').remove();

// EDIT

$('.main').not('.main-left');

V
Vlad Pasechnik, 2015-09-03
@jumper423

I dare to suggest that you had to write it down like this
. Better html skinte.

S
Sergey Melnikov, 2015-09-03
@mlnkv

$(selector).not(selector2);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question