Can't figure out why my id isn't being targeted by my function


Oops, try again. Did you target the 4th li child of the ordered list? Check the Hint if you need help.

``` // Relevant HTML
    <li>Start with the function keyword</li>
    <li>Inputs go between ()</li>
    <li>Actions go between {}</li>
    <li id= "yolo">jQuery is for chumps!</li>

// Relevant Jquery

$(document).ready(function() {
    var $target = $("#yolo");
    (function() {


 (function() {

why are you using anonymous function for it?

you can directly write


and if you really want to use that function then call it at the end

 (function() {
    })(); // () calls that function


Oh i forgot i had to call it, i percieved writing the function inside document.ready as sufficient for it to trigger itself on page loading.

Thank you very much for your quick answer, was really helpful

PS: i want to use unecessary anonymous function beacause i don’t know what i’m doing yet, and i like to fail in every way possible until i can write things even in uneccessary complex fashion as soon as i can/find how to, so as not to fail in trickier settings later on. Some mentality i got from training to play piano, where i didn’t settle for being able to clear a performance - instead i trained for being unable to fail whatever i was playing


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.