Menu
Hi, I need help.
I have a function that loops through all the links and assigns a default data-content attribute.
`getContent: function () {
$(‘ul#links a’).each(function () {
var t = $(this),
content = ‘this is a default content’;
t.attr(‘data – content’, content.tolowercase());
})
}
I want to replace the default data-content with the content from the link but I can’t get it to work.
I’m thinking something similar to this.
`getContent: function () {
$(‘ul#links a’).each(function () {
var t = $(this),
content = $.get(t.attr(‘href’)
t.attr(‘data – content’, content.tolowercase());
})
}