How to safely check for a attribute value with Jquery?
<p>If a clicked link has target="_blank" set as an attribute, I want to call window.open, otherwise I set a iframe to load the page.</p>

<p>How do I check the attr and make sure it doesn't crash if the value is null etc.</p>

<p>I have this so far:</p>

<pre><code>if ($(that).attr("target") == "_blank") {
       window.open(linkHref, "_blank");
}
else {
       document.getElementById(someFrame).src = linkHref;
}
</code></pre>

<p>I am scared that if <code>$(that).attr("target")</code> is not set, or is empty, it will crash.</p>
