Whenever I select element with jquery with selector it select element from old value instead of new value if I get value of selected element it give me new value. My code is here http://jsfiddle.net/HUdkN/3/.
Here I have use Australia value for selecting element ,even if I change value. It will select element. Why ??? could somebody explain it.
HTML CODE
<input type="text" class="lbl" value="Australia" />
<div id="result"></div>
<br />
<br/>
<input type="button" value="check" id="check_btn">
JAVASCRIPT CODE
function check_fnc() {
jQuery('input').removeClass('error');
jQuery('input[value="Australia"]').each(function () {
$(this).addClass('error');
$('#result').html(this.value);
});
}
$('#check_btn').click(function () {
check_fnc();
})