Bonjour à tous,
Je travaille sur un projet et je suis un peu embêter car je n'arrive pas à accéder à l'attribut data-category pour récuperer une liste de catégorie,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 {% for tool in abcIngTools %} <div class="col-sm-4 col-tool {% if user is defined and not user is empty %} {{ tool in user.favoriteTools ? 'favorite-tool' : 'no-favorite-tool' }}{% endif %}" data-tool="{{ tool.slug }}" data-category="{{ tool.category.nameCategory }}" </div> {% endfor %}La console me retourne q
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 for(let tool of $('.col-tool')) { console.log(tool.data('category)); abcingTools.push(tool); console.log(abcingTools); }Auriez-vous une solution ? svp
Code : Sélectionner tout - Visualiser dans une fenêtre à part jquery.min.js:2 Uncaught TypeError: tool.data is not a function
Partager