I am trying to prepend something to a li, hosted inside a #container #boxes #third li a but it isn’t quite working.
I am using the following code:
$('#container #boxes #third li a').append(kevintext);
But whenever I do that, nothing happens. You can see the code in action at my testing page here.
Because that didn’t work, I tried something else: to replace a span inside my footer with other text (so people with JavaScript disabled won’t see “hover over me” and try to hover).
I used the following code:
$('#footer span').replaceWith('<i>For design info, mouse over me.</i>');
That didn’t work either, so I am thinking this probably has something to do with my code, and possibly one fix will solve both problems?
Please help.
What you have should work. The main reason it probably isn’t is because (at least by the quick look I took at assets/script.js) you are trying to run this outside of $(document).ready() – without wrapping your code in this function (which you did do for another part) the elements will not have been created yet, so at that point nothing will happen.