Unable to click on an input field with the mouse after selecting a background image

When working on an HTML page, we encounter a form with user id and password fields along with a background image. Initially, everything seems fine as we can select the input fields and enter data without any issues. However, if we happen to click on the background image first and then try to select an input field to enter data, it doesn't work as expected.

This issue is specific to IE8; we do not observe this behavior in IE9 or Firefox. Any assistance would be greatly appreciated.

Answer №1

Check out this code snippet:

onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"

Here's an example of how you can use it:

<input type="password" id="PASSWORD" name="password" value="1234567890" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">

I also prepared a demo fiddle just for you!

https://jsfiddle.net/1zhdLb55/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to style a div's height responsively behind a circle using CSS

Can a CSS pattern be created with responsive design, ensuring that the background line is always in the correct position and height regardless of window size? https://i.sstatic.net/27Tf2.jpg ...

Tips for eliminating anchor links from headings in Markdown?

When using Github and creating a header that is h2 or smaller (##, ###, ...) an anchor link appears automatically to the right of the header. By clicking on this anchor, you are directed to the page with the corresponding header displayed at the top of the ...

Designing a website using HTML and CSS with the goal of optimizing it to fill

My website includes all the recommended elements in the head area: <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="width=device-width, ...

What's the best way to conceal scrollbars in Nuxt2 whilst preserving one for the description?

The Issue My goal is to remove scrollbars from all pages (which I achieved successfully), but keep one visible for a specific section of description. What I Attempted I tried adding the class .scroller and only displaying it for the <div> containi ...

Extract the URL from an iframe using either coding techniques or through user interaction

I am in the process of creating a website that will serve as a wrapper around a third-party site using an iframe. My goal is to allow users to browse the third-party site within the iframe, then share the URL with the main site for storage. My objective i ...

Choosing individual child elements, with matching names, from two distinct parent elements with identical names

As a beginner in coding, I understand that my code may be messy and redundant, so I apologize for any confusion it may cause. I am working on adding the final piece to my navigation bar. Below is the HTML code, and a fiddle link will be provided at the en ...

The offcanvas menu in the NextJS Tailwind website does not handle hover or tap events properly when outside of the parent dimensions

My header includes an off-canvas menu that slides in from the right side. Everything seems to be working fine, except for one issue: when the menu is open and visible, the mouse and touch events pass through it to the content underneath. Check out the cod ...

IE causing Ul LI Menu to not display as Block

I'm encountering an issue with my menu. It displays correctly in Firefox and Chrome, but in IE8 it appears as a vertical list instead of a horizontal menu. I have included a doctype and I am linking to the HTML5 JavaScript via Google, so I'm not ...

Adjusting the size of Bootstrap cards to ensure they are uniform in appearance

Currently, I am facing an issue where the card-img-top in my bootstrap cards are resizing unevenly. I am looking for a CSS solution that can help me make them consistent while ensuring that the quality remains the same or similar. https://i.sstatic.net/ja ...

Can a website be created to cater to all screen resolutions, from mobile devices to PCs?

Is it possible to create a website that is flexible and can stretch like elastic rubber, accommodating text, images, videos, JavaScript, and accessible from all web-enabled devices? I envision setting a maximum width of 980px for the site, allowing for a ...

Looking to spice up your jQuery modal dialog with unique and varied styles?

Can anyone explain why the grid displayed in our jQuery modal dialog (jqGrid) appears with different styles, specifically font size, compared to the grid on our main screen? I would appreciate any insights or suggestions. ...

Will HTML eventually include a syntax for image spriting?

My knowledge of the latest CSS updates is a bit outdated, so I thought it was worth inquiring; The <img> tag is typically written as <img src="/url.png" />, with auto or specified height and width. While I appreciate CSS sprites for their fast ...

The .AppendChild() method does not appear to be working as expected following the completion of

Encountering a peculiar problem here. The scripts run smoothly, but the content doesn't display on screen until I "inspect element" and then close the inspector window or zoom in/out. It's not an issue with the "display" CSS property because even ...

Can someone guide me on how to make an array filled with dates using Javascript?

I am working on developing a Javascript code that can identify all the days leading up to the current date. Here is what I have managed so far: var titleArray = [ "title1", "title2", ]; var pictureArray = today.toString(); var thumbArray = today.toString ...

Is there a way to effectively utilize Twitter Bootstrap classes such as "row" and "span(X)" specifically for @media print?

Currently, I am facing the challenge of printing web pages on my website and I am seeking advice on how to effectively utilize the row and spanX Bootstrap classes to better manage the content displayed on the printed page. For instance: <div class= ...

How to perfectly center an absolute positioned icon on a 767px screen

The icons positioned absolutely in the two columns must remain center aligned across all screen resolutions. The media query below attempted to align the icon on mobile devices, but it is inaccurate for any resolution. How can I correct the CSS? @media scr ...

Issue with JQuery show method not functioning correctly in Prestashop

I am using prestashop 1.6.x.x along with the blocklayred navigation module to filter results on my category list page. I want to hide the category description when filtering the results... I added this code which hides the category description, but it doe ...

AngularJS - changes to service variables within ng-include view controller are failing to update parent controller

I am facing an issue with updating the values of an object stored in a service. The object's members are being set from a kendo-ui treeview's select event handler within a controller. This view, along with the treeview, is included in a second v ...

Encountering a 404 error in Next.js when deploying static output without the .html extension

My website is built using Next.js and is deployed statically through FileZilla. When accessing the root of my website, I do not need to add a .html extension: https://www.mywebsite.com However, when trying to access any other page on the server, I receiv ...

Create a PHP script that utilizes the DOMDocument class to parse and manipulate a table

Struggling to maintain the inner HTML tags while displaying rows in an HTML table? Can't seem to get it right and the tags keep getting stripped out? What's the best approach to ensure each row retains its inner HTML tags? Below is the code I ha ...