Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to use javascript to add a property to an HTML input control? I would like to add a property that would contain the original content of the text box to verify if it has been changed by the user. Now I am using a hidden control, but I would like to make it easier to check for a change.
Posted
Comments
SWKFalcon 13-Apr-12 8:10am    
This works well on any text field. Fortunately, I don't have many other types of controls. Thanks.

1 solution

There is already an attribute that contains the value that was assigned to text inputs and textareas from the HTML - defaultValue.

See http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26091157[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900