Using jquery how to know the target value of a href link. for example if my link was
<a href="someurl.com" id="the_link" target="_blank">link</a>
target will be _blank
Using attr ()
$('#the_link').attr('target');
Jsfiddle example .
I will be different and will teach you partially vanilla js, acting directly on the properties of the elements:
$('#the_link')[0].target;
If you use jQuery> = 1.6 you should use .propthan .attrreally
.prop
.attr
$('#the_link').prop('target');
Use attr ()
alert($('#the_link').attr('target'));
Simply
$('a').attr('target')
Gotta do it
( jQuery.attr Documentation )