I have the following...
$(document).ready(function() {
$('p:contains("You")').parent('span').prev('input').addClass('error');
});
My function works fine given that it adds the class to the correct inputs but it should only add the class if the paragraph containing 'you' is display:inline.
Has anybody any idea of how I can do this?
My markup for each input is similar to this....
<li class="yourdetli">
<label class="yourdet">House Number</label>
<input type="text" id="ctl00_ContentPlaceHolder1_TB_HNumber2" name="ctl00$ContentPlaceHolder1$TB_HNumber2">
<span style="color: Red; display: none;" class="errorp" id="ctl00_ContentPlaceHolder1_RequiredFieldValidator9">
<p>You must complete this field</p>
</span>
</li>
visiblespecific enough?<p>inside a<span>.