I am trying to do this
$('input').val($('input').val()+"^2");
so each input field in the page (I have only one field) will have two extra letters ^2
the strange thing is that it only append 2 and ignore the ^ symbol. any idea why this strange behavior occurs?
EDIT: The problem was that there were another part in the code removes all symbols from the input field once they are inserted. So I changed it to ignore this symbol. Thanks guys.
^. Try^2.$('input').val()it will return the value of the first input, so your code will set all input values to the value of the first input with your modification.