skip to Main Content

Jquery – Click event for dynamic id from dynamic elements not working

My footer elements are loading with dynamic id's. I used as follows $(document).ready(function () { $("[id^='footer']").click(function (evt) { evt.preventDefault(); if (window && window.siteConsent && window.siteConsent.manageConsent) { window.siteConsent.manageConsent(); } console.log(evt.target.id) }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <a href="level2Link.NavLink" class="f-link managecookieShow" id="footer-nav-ManageCookies one1" aria-label="level2Link_AriaLabel">…

VIEW QUESTION

Javascript – Taking specific values in a JSON file and make another JSON file with extracted

I have a JSON file that is taken from the data of the project. However, there are information in it that I do not need for my specific goal. This is the JSON data: const toSql = [ {"id":1,"battlerName":"Actor1_1","characterIndex":0,"characterName":"Actor1","classId":1,"equips":[2,0,0,3,0],"faceIndex":0,"faceName":"Actor1","traits":[{"code":51,"dataId":2,"value":1},{"code":51,"dataId":4,"value":1}],"initialLevel":1,"maxLevel":99,"name":"Reid","nickname":"","note":"","profile":""}, {"id":2,"battlerName":"Actor1_2","characterIndex":1,"characterName":"Actor1","classId":1,"equips":[1,0,0,9,0],"faceIndex":1,"faceName":"Actor1","traits":[],"initialLevel":1,"maxLevel":99,"name":"Priscilla","nickname":"","note":"","profile":""},…

VIEW QUESTION
Back To Top
Search