Jump to content

grab value <a value="this"> jQuery


godsent

Recommended Posts

I would like to grab value of "uid" of this code:

<a href="# class="hop" uid="1"><code>1</code></a>

 

I am using this code:

var clicked = $(this).parents('a[uid]:eq(0)').attr('uid');
alert(clicked)

 

Still getting 'undefined', can't figure out whats wrong.

 

The worsed thing that almost the same code worked before for "li"

<li ID="123"><a class="hop highlight" href="#">text</a></li>
$(this).parents('li[iD]:eq(0)').attr('ID');

 

 

I can't figure out the problem, if you know please help.

Link to comment
https://forums.phpfreaks.com/topic/193547-grab-value-jquery/
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.