Element IDs Are Not Being Recognised And Are Not Triggering Function
Solution 1:
The problem:
ID's are meant to be unique identifiers. You should be using classes if you want to identify multiple elements. For this reason, when you select by ID with $("#font")
, jQuery (which uses native javascript's getElementById
) will only return the first element it comes across that has that ID. This is because if the DOM is valid, it shouldn't find anymore instances of that ID and it would be a waste of processing to continue looking.
A solution:
Remove the font
ID's from your div
s and replace them with a class instead, like class="font"
. Since you already have some classes identified, you can use multiple classes separated by spaces, like: class="font minecrafter"
. After doing this, you will be able to select your elements with the font
class using this selector: $(".font")
Post a Comment for "Element IDs Are Not Being Recognised And Are Not Triggering Function"