I'm targeting this div to add HTML after (using jQuery after) this:
<div class="wpv-setting-container wpv-setting-container-horizontal wpv-settings-layout-markup js-wpv-settings-layout-extra">
For some reason due to technical requirements of the application, I'm forced to use the class wpv-settings-layout-markup
. However, there is also another div that contains this class but its hidden:
<div style="display:none;" class="wpv-settings-templates wpv-setting-container wpv-setting-container-horizontal wpv-settings-layout-markup" id="attached-content-templates">
Now when I use the class name in my jQuery after method, it is added to BOTH the visible and invisible div.
$(".wpv-settings-layout-markup").after('data here');
How can I revise this selector:
$(".wpv-settings-layout-markup")
To target only the visible div? Thanks a lot.