• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

C# and jQuery

I have in my web Application the following code ..so it's easy to Add attribute to the TextBox in server-side code.

My question_#1: "How to add  attribute to the TextBox in client-side code using jQuery?".

My question_#2: "How to remove  attribute from the TextBox in client-side code using jQuery?".


Server side code below:

 txtTextBox1.Attributes.Add("placeholder", "First_Name"); // add Attribute to TextBox

txtTextBox1.Attributes.Remove("placeholder");  // to remove Attribute

Thanks
0
niceguy971
Asked:
niceguy971
1 Solution
 
kswathiCommented:
in Jquery you can
 add/ remove  the attributes


$("txtTextBox1").attr('placeholder','First_Name');


$("txtTextBox1").removeAttr('placeholder');

for futher reference you can also see:
http://api.jquery.com/attr/
http://api.jquery.com/removeAttr/

Hope it helps.
0
 
niceguy971Author Commented:
Thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now