This is my code: i want change value of city when click button
function add()
{
$("#city").attr("value","abc");
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type='text' id='city' value="123"/>
<input type="button" id='btnChange' value="Change" onclick="add();return false;"/>
If after Page load , i click button ,it working ok: city =abc
.
But if after Page Load, i select and delete text "123", i click button , it not working. city=""
Why can't set value of input text by jquery after delete text?