Solved

C# and jQuery

Posted on 2012-03-13
2
171 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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now