Hi,

I have the code below to add a highlight class to the parent div if an
input field gets focus

---------
jQuery(this).parents("div:eq(0)").addClass('highlighted');
----------
<div class="formrow">
  <input type="text">
</div>
----------

This works fine, but I would like to further specify the filter
expression in the parents() function to only include divs that have
the attribute class="formrow":

parents("div:eq(0)")

Is this possible?

PS: Sorry, I'm relatively new to jQuery, so if there's a better way to
do this I'd like to hear it!

Thanks in advance,

rudgr

Reply via email to