jQuery see if next element (not sibling) exists

Posted by DevlshOne on Stack Overflow See other posts from Stack Overflow or by DevlshOne
Published on 2012-11-11T04:43:55Z Indexed on 2012/11/11 5:00 UTC
Read the original article Hit count: 86

Filed under:
|
|

Here's my HTML code:

<select class="grid_3 required jobData valid" id="clli" name="clli" style="font-size: 10px; border: none;">
<option value="0">Select One...</option>
    <option value="905"></option>
    <option value="931">0</option>
    <option value="1">ABRDMSES</option>
</select>
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<img alt="This data has been changed!" title="This data has been changed!" src="images/caution.png">
<select class="grid_3 required jobData" id="job_status" name="job_status" style="font-size: 10px; border: none;">
<option value="0">Select One...</option>
</select>

When a $('#clli').change(); occurs, I slap a caution image next to it to warn the user that there are changes to be saved. However, if they make more than one change to the same element, I first want to see if there is already a caution image there before sending a new one. Any theories/methods on how to just scope out the next (but not $.next()) element?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery