0

I want to add div after another div with class="col-md-12 col-sm-6 stm-filter_transmission". How should I do that? This is not working:

<script>
$(function (){ 
    $( ".col-md-12 col-sm-6 stm-filter_transmission" ).after( "<p>Test</p>" );
}); 
</script>
  • 2
    Change `".col-md-12 col-sm-6 stm-filter_transmission"` to `".col-md-12.col-sm-6.stm-filter_transmission"`. In both CSS and jQuery, to select an element with multiple classes you concatenate them with `.` and no space. The space means select a descendant. E.g. https://stackoverflow.com/questions/2554839/select-element-based-on-multiple-classes – j08691 Mar 29 '21 at 19:52
  • Thanks. My main problem was `jQuery: $ is not a function` but I have solved it already. – Sasha Sasha Mar 29 '21 at 20:07
  • Does this answer your question? [How can I select an element with multiple classes in jQuery?](https://stackoverflow.com/questions/1041344/how-can-i-select-an-element-with-multiple-classes-in-jquery) – AloHA_ChiCken Apr 05 '21 at 01:58

0 Answers0