Jump to content

jQuery .attr Error


Drompo2

Recommended Posts

I have a function that grabs the title from a li and split what ever the title up that is seperated by a '|'

function RemoveFunction(data) {
var get = $(data).attr("class");
var getitem = $(data).closest("li");
var cat = $(getitem).attr("title");
console.log($(cat));
var cats = cat.split('|');

This just returns blank on console, but yet

console.log($(getitem).attr("title"));

Outputs correctly in console :s

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/245628-jquery-attr-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.