Avatar of Fern2
Fern2Flag for Iceland

asked on 

Javascript change value of textbox on click (select)

I have a textinput were I need to change value if clicked on or selected. Normal state is novalue and if selected the value changes to "H" and if the textbox id selected again it should go back to normal state "no value"
Web DevelopmentJavaScriptScripting Languages

Avatar of undefined
Last Comment
Fern2
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

<input type="text" onfocus="this.value='H';" onblur="this.value='no value';">
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

whoops...  sorry pravinasar
Avatar of Fern2
Fern2
Flag of Iceland image

ASKER

Thanx a lot :-)
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo