Two image buttons with the same image

I have two image buttons on my page:

<input type="image" src="logg.png" name="saveForm" class="btTxt submit" id="saveForm" />
<input type="image" src="logg.png" name="saveForm1" class="btTxt submit" id="saveForm1" />

      

The problem is the button image is not loading. However, when I get rid of one of the buttons, everything is fine. Buttons have different names and IDs, what's the problem?

+3


source to share


2 answers


You are missing ALT values. This is required if the image cannot be loaded: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input

Here's an alternative approach:



Create two <buttons>

or <input type="submit">

and create their background with css.

If your goal is to present a png image in a form, there is a similar answer here: <button> background image

+1


source


Check that the location of the image source is correct and the image is available where the browser is located. Make sure to right click on the image button use the option Inspect element

(only available in higher versions of browsers) and check the location of the image source.

In the ur case, the image should be available in the same folder where the html is available.



Check for typo errors.

0


source







All Articles