I have a text box in html form like this
'< input id="yourinput" type="text" >'
Once user enters text in it and moves out i want to make the border to 1 px (so that it does not look like a normal text field). I achieve this by
$("#searchforstatus").css("border", "1px");
Now, when the user comes back to the text field, i want to make the text field look like original normal looking text field with the exiting value in it.
Assuming that you want the
inputto look different only when it contains a value, I’d suggest this:And define the
borderedcss class in the css file (rather than adding/removing css properties in jQuery withcss()), for example:Demo at JS Fiddle.