Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

onclick

Featured Replies

Hey again everyone.

 

Sorry for mutliple posts. I have an input field which has default text in it that clears when the user clicks it. However the text only reappear when you refresh the page. Ideally I'd like the text to appear in the text move again as soon as the user clicks somewhere else in teh page. Here is my code at the moment.

 

<input class="last" name="txtCriteria" type="text" value="enter road name or postcode" id="postcode" onclick="this.value = '';" maxlength="20"/>

 

May I want some kind of offclick on onmouseout command?

 

Thanks for any help

You want to replace "onclick" with a combination of "onfocus" and "onblur".

 

If you'll pardon the shameless self-promotion, a little while ago I wrote a script to do exactly what you're talking about, and I explained each part of the script and the reasons behind it Clearing the Value of Form Elements

 

Of course, I wrote that over 6 months ago and I'd probably doa coupe of things differently now but the basics are all there and the script will fundimentally work

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.