Solved

C# and jQuery

Posted on 2012-03-13
2
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article discusses how to implement server side field validation and display customized error messages to the client.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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