jQuery: Adding two attributes via the .attr(); method
<p>Although I have this one working, I'm not sure if there's a better way to do it, or if the way I got it is the right/only way.</p>

<p>Basically what I'm doing is replacing all the <code>target="_new"</code> or <code>target="_blank"</code> attribute values to <code>target="nw"</code>, this way only one new window is open and in it all other new windows will open in order to not overwhelm the user with multiple windows. </p>

<p>I'm also adding a "<em>Opens in a new window</em>" <code>title=""</code> attribute.</p>

<p>So the solution I created is this one:</p>

<pre><code>$("a[target='_blank'], a[target='_new']").attr('target','nw').attr('title','Opens in a new window');
</code></pre>

<p>Notice the two <code>.attr();</code> methods.</p>

<p>Is this the correct way to add two attributes to an element?</p>

<p>I tried <code>.attr('target','nw','title','Opens in a new window')</code> but it didn't work.</p>

<p>The reason I ask is because of the DYR (Don't Repeat Yourself) principle, so if I can improve the code I have, great, if not, then it is what it is.</p>

<p>Thanks.</p>
