[Solved] Javascript Console Commands Not Working After Ajax Sending Back in Page

[ad_1] there are a couple ways to achieve this. the easiest: will probably be to create a snippet in the web developer tools, and run it from there. Another manner would be to create a google extension (with ‘declarativeContent’ and ‘activeTab’ permissions) that can inject content script or execute script on a page. you can … Read more

[Solved] How can I console.log the second li element using javascript onclick

[ad_1] Just use the querySelectorAll() method instead and target the second li element like this: document.querySelectorAll(“#list li”)[1].onclick = () => { console.log(“Biker Jacket”); }; <h3>Shirts</h3> <ul id=’list’> <li>Biker Jacket</li> <li>Mens Shirt</li> </ul> 1 [ad_2] solved How can I console.log the second li element using javascript onclick