I want to know is there any way to add a custom attribute to the a
HTML element.
For example ,
<input type="text" name="txtNAME1" displayName="dname1" />
In the above example the custom attribute “displayName” is not a
standard HTML attribute. So I want to know if I can define the same and push the intended value to the server and access the same attribute’s value.
Thanks in advance!
Which language are you using? You can do this in C# using
Then, in the code behind:
You can also access it in jQuery with
and send it through to the server via a handler.