JQuery empty selector and setting values
<p>If the following selector has a length of 0</p>

<pre><code>$(".my_class")
</code></pre>

<p>and I try to do <code>$(".my_class").attr('value', 'test');</code></p>

<p>It doesn't cause any errors, but should I be checking the length first? What is considered a best practice?</p>

<p>I have a bunch of properties that may or may not exist and am wondering if it is ok to just set an empty jquery value.</p>
