I'm trying to create a simple form that changes color or somehow shows it's been edited (doesn't matter how) upon editing and not saving/submitting—not during the change, but right after. Say I have this small form, just to make it concrete:
<form action="" id="contact-form" class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="message">Message</label>
<div class="controls">
<textarea class="input-xlarge" name="message" id="message" rows="3"></textarea>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn">Submit</button>
<button type="reset" class="btn">Cancel</button>
</div>
</fieldset>
</form>
I'm sorry I don't have any starting JS to show, I don't know how to write a function from scratch and I didn't know what to search for online to find some code I could tweak.
Thanks!
EDIT: I want the changes to be indicated if you've put content into the box, but if you end up deleting it even after making several changes, I would like the indication to disappear as if you haven't changed anything. I don't want it to continue working after page refresh (would rather it just went back to its original state).