Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

stoops posted:

i tried to get the nodeid like so but my value keeps coming back undefined.

value = $("li[data-nodetext='" + value + "']");

console.log(value.nodeid);

For one you are overwriting value there, which you probably don't want to do.

Secondly, you need to read the nodeid with the data() method.

Here's a working example: https://fiddle.jshell.net/b3dtvkho/

EDIT: I think this is the first time I've used jQuey in at least two years.... :monocle:

Adbot
ADBOT LOVES YOU

stoops
Jun 11, 2001

Lumpy posted:

For one you are overwriting value there, which you probably don't want to do.

Secondly, you need to read the nodeid with the data() method.

Here's a working example: https://fiddle.jshell.net/b3dtvkho/

EDIT: I think this is the first time I've used jQuey in at least two years.... :monocle:

Thanks, I appreciate this. I followed your example and I'm still getting a null on my nodeid. I'm gonna doublecheck my code. Thank you again.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

stoops posted:

Thanks, I appreciate this. I followed your example and I'm still getting a null on my nodeid. I'm gonna doublecheck my code. Thank you again.

Glad to help out. If you can post more of your code (the bits that are erroring in the console and what is around it for context) we can maybe see what you are missing.

  • Locked thread