Solved

C# and jQuery

Posted on 2012-03-13
2
174 Views
Last Modified: 2012-06-27
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
Comment
Question by:niceguy971
2 Comments
 
LVL 6

Accepted Solution

by:
kswathi earned 500 total points
ID: 37718491
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
 

Author Closing Comment

by:niceguy971
ID: 37895661
Thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question