skip to Main Content

jquery check if following LI has class

In jQuery - how can I check to see if a <li> that follows another has a class or not. Markup is: <ul> <li><a href"#">Title 1</a></li> <li class="LI_sector_child"><a href"#">Title 2</a></li> <li><a href"#">Title 3</a></li> <li><a href"#">Title 4</a></li> </ul> So, I want…

VIEW QUESTION

Dynamic Menu from multiple JSON files – Jquery

I would like to create a menu from multiple JSON files. Please see the following: https://jsfiddle.net/varJSFiddle/teghqov0/10/ The desired output would be a dynamic menu that looks something like: <ul class="filter-menu-wrapper"> <li class="filter-menu is-active" id="filter-menu_01"><span class="filter-category">Type<i class='cstm-icon-glyph cstm-icon-glyph-plus'></i></span> <div class="filter-options"> <span…

VIEW QUESTION

jQuery HTML Conditional Statement

What is a good way to ignore the tags/variables in a jQuery HTML method? For instance, if there was no value for company, it would not be included in the HTML. $('.modal-body').html(` <p><span style="font-weight:bold;">Name:</span> ${name}</p> <p><span style="font-weight:bold;">Company:</span> ${company}</p> <p><span style="font-weight:bold;">Job:</span>…

VIEW QUESTION

jQuery selector for data attribute array

Theres' this html code: <div class="wcpa_form_outer" data-attrrelated="[&quot;wcpa-select-1658734650073&quot;]"> for which i'm trying to append html to it. I have tried various approaches but none have worked. jQuery('.wcpa_form_outer[data-attrrelated="[&quot;wcpa-select-1658734650073&quot;]"]').append('some html here'); or jQuery('.wcpa_form_outer[data-attrrelated="[wcpa-select-1658734650073]"]').append('some html here'); or jQuery('.wcpa_form_outer').data('attrrelated').append('some html here'); any clues?

VIEW QUESTION
Back To Top
Search