I have an onclick function for an <ul><li>,
but I need to set a variable from the id of an <a href> tag insde the <li> and I'm not sure how.
I have:
$('#dropdown ul li').click(function(){
var picked = $(this).attr('id'); // this part I don't know.
// var picked = $(this).href('id'); didn't work.
$('picked1').innerHTML = picked ;
});
/* pulling from a list of items that look like:
<li id='name_1'><a id="name_a">text1</a></li>
<li id='name_2'><a id="name_b">text2</a></li>
<li id='name_3'><a id="name_c">text3</a></li>
If I clicked 'name_2', (this), i need to set a variable from 'name_b', within it.
*/