I tend to believe that if you’re resorting to this behavior, you should probably step away from your computer for a while and rethink your approach to whatever it is you’re trying to accomplish. Nevertheless, it seems to work. So, in the event you find yourself running out of attributes to use on a tag, likely to contain descriptions of some sort, it turns out you can add arbitrary name/value pairs which jQuery can use as search terms. Consider the example: jQuery:
<script type="text/javascript">
<!--
$(document).ready(init);
function init() {
alert($(document).find('p[keith="interesting"]').html());
}
-->
</script>
HTML:
<p keith="interesting">Fascinating.</p>
Here, I narcissistically add the "keith" attribute, assigning it a value of "interesting," to a <p> tag which wraps the text "Fascinating." When the document is ready, I ask jQuery to search the document for any <p> tags whose "keith" attribute has a value of "interesting," then invoke an alert dialog to display the inner HTML of the first tag returned. I would certainly not recommend relying on this technique for anything other than shock value. I’m shocked to have stumbled across this phenomenon. I would absolutely NOT be shocked if this stopped working inexplicably. Use at your own risk.