Here is the code snippet I'm using to inject a style that should be applied to a Div containing both the styles: .noindex and .ms-wpContentDivSpace
<script>
$(document).ready(function(){
$('.noindex, .ms-wpContentDivSpace')..css({
overflow: auto,
height : '150px'
});
});
</script>
<style>
.autoScrolListViewWP
{
HEIGHT: 150px;
OVERFLOW: auto
}
</style>
<script>
$(document).ready
(
function()
{
$('.noindex, .ms-wpContentDivSpace').addClass('autoScrolListViewWP');
}
);
</script>
However, I want the new CSS class autoScrolListViewWP to only be added to elements with the specific combination of classes: .noindex and .ms-wpContentDivSpace
The current script applies the style to any combination where these two classes exist. For example: .ms-WPBody, .noindex, and ms-wpContentDivSpace autoScrolListViewWP
So, my question is how can I identify only a specific combination of CSS classes?