I want to get the href attr value based on the value of the rel attr . How do I do this in javascript?
<links>
<link href="https://someurl/index/16380" rel="self"/>
<link href="https://someurl/index/16380/streams?lang=en" rel="streams"/>
<link href="https://someurl/index/16380/bif" rel="bif" />
</links>
something along the line ....
$(xml).find('link').each(function(){
if(rel == 'streams'){
this.streamurl = $(this).attr('href');
}
});
$(this).attr('rel');, unless I'm missing something here?$(this).attr('rel')with the value you want it to have. It's just really basic and you appear to be a decent programmer that's why I'm confused here.