---
title: "Is it possible to change input value using CSS?"  
description: "Is it possible to change input value using CSS?"  
author: "Anonymous User"  
published: 2013-03-05  
updated: 2013-03-05  
canonical: https://www.mindstick.com/forum/619/is-it-possible-to-change-input-value-using-css  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Is it possible to change input value using CSS?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!

Can I change an [input](https://www.mindstick.com/forum/159209/how-can-i-read-convert-an-input-stream-into-a-string-in-java) [field](https://www.mindstick.com/forum/160867/does-mindstick-provide-training-for-field-marketing) [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) using CSS when [user clicks](https://answers.mindstick.com/qa/34556/if-a-user-clicks-all-the-google-ads-on-my-site-is-it-foul) it?

Like:

<input type=text [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide)=[username](https://www.mindstick.com/forum/12798/there-is-no-viewdata-item-of-type-ienumerable-selectlistitem-that-has-the-key-username)>\
<input type=[password](https://www.mindstick.com/blog/118/retriving-user-password-by-using-stored-procedure-in-asp-dot-net) name=password>

\
So, when the user [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) into this field, the text will go away and he will be able to write something.

Thanks!

## Replies

### Reply by AVADHESH PATEL

Hi John!

\
If you change input value then you can do as below, there is no role of css

<input type="text" name="username" placeholder="Username" />

Because "placeholder" attribute not suported by all browser, then you can achive this using JavaScript.

<input type="text" name="username" onFocus="if(this.value=='Username') this.value='';" onBlur="if(this.value=='') this.value='Username';" value="Username" />


---

Original Source: https://www.mindstick.com/forum/619/is-it-possible-to-change-input-value-using-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
