Remove the input box for submission from the HTML code


How can I remove the 'button' from my input field and replace it with an image? Even after trying different methods, the box still appears.
Thank you.

<!DOCTYPE html PUBLIC "">
<head>
<style>
#PlusMinus{background:url('images/sprites.gif') 0px -391px;left:0px;width:13px;}
#PlusMinus a:hover{background: url('images/sprites.gif') 0px -406px;}
</style>

<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type='text/javascript'>
    var fontSizes = [14, 16]
    $(function(){
      $('#PlusMinus').click(function() {
        if($(this).val() == "+") {
            $('#OurText').css('fontSize', fontSizes[1] + 'px');
        $(this).val("-");
        }
        else {
        $('#OurText').css('fontSize', fontSizes[0]+ 'px');
        $(this).val("+");
    }
       $("body .h6").toggle();
    });
});
</script>
</head>
<body>
    <h6 class="noSpan">
      <!--HERE'S THE INPUT-->
      <input 'submit' id='PlusMinus' />
      <span class="h6">Larger</span>
      <span class="h6" style="display: none">Smaller</span>
    </h6>
    <h5 id="OurText" class="p">TEXT</h5>
</body>
</html>

I've tried using input 'submit, image, and button', but that persistent box keeps showing up.

input 'submit' id='PlusMinus'

Answer №1

<img src="[path]" />

Include the "src" attribute in your input tag

Answer №2

Consider removing the background, border, and background color properties.

#PlusMinus{
background: none;
background-color: none;
border: none;
background-image: URL(../images/yourimage.jpg) no-repeat;
}

You can adjust the height and width of this element to align perfectly with your background image.

Ensure to specify the correct input type:

type="button" type="submit"

and so on

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

.NET and Azure integration for asynchronous HTTP requests

My Ajax function is running smoothly on my local machine when the site is accessed locally. However, an issue arises when deploying it to Azure - if one of the parameters contains a line break, I get an error message: "The specified URL cannot be found", i ...

Why is it necessary for me to utilize JSONP?

What is the significance of using JSONP? A few days ago, I inquired about not receiving a response from a rest server while using jQuery. It turns out that I need to utilize JSONP. I tested this on my own server and it was successful. Now, I am tasked wi ...

Can you explain the distinction between using a period in a class selector and not using one?

Could someone please clarify the meaning of the code snippet below? <div class="cls1 cls2">abcd <div class="cls2"> adfffff </div> </div> .cls1 { background-color: yellow; } /*sample1 .cls1.cls2 { color: red; } */ /* ...

How can I keep images from getting cut off when using slick slider with a fixed background?

My current design includes a stylized slick-slider that extends beyond the top border: However, I have set a fixed background for .slick-list, ensuring only the content (text, picture, and button) scrolls: How can I avoid the picture being cropped in t ...

CSS for a navigation menu with underlined links

I am attempting to create an underline effect when hovering over a link. However, I am facing an issue where the underline does not align perfectly with the line below it. Can someone please guide me on how to modify this CSS so that when the link is hov ...

Executing a JavaScript/jQuery function on the following page

I'm currently working on developing an internal jobs management workflow and I'd like to enhance the user experience by triggering a JavaScript function when redirecting them to a new page after submitting a form. At the moment, I am adding the ...

Trouble with Bootstrap Modal not closing properly in Chrome and Safari

ISSUE: I'm facing a problem where clicking on the X (font awesome icon) doesn't close the modal popup as expected. https://i.sstatic.net/yXnwA.jpg LIMITED FUNCTIONALITY ON CERTAIN BROWSERS: Currently, the X button for closing the modal works o ...

Implementing slideDown() functionality to bootstrap 4 card-body with jQuery: A step-by-step guide

Here is the unique HTML code I created for the card section: <div class="row"> <% products.forEach(function(product){ %> <div class="col-lg-3 col-md-4"> <div class="card mb-4 shadow "> &l ...

How can a chat script be created efficiently without needing Server Root Access?

I currently have a hosting account (cPanel or DirectAdmin) where I don't have root access and am unable to use exec() or shell_exec() functions due to restrictions set by the server administrator. While I understand that socket programming is conside ...

Refine information by using checkboxes with the help of jQuery, MySQL,

How do I use PHP and jQuery to filter content with checkboxes? I'm getting a warning about an undefined index when I try to post the form via jQuery. Check out my JavaScript file: function filterContent(){ var all = $(".all").val(); $('input.al ...

What is the best way to display breadcrumb text on a new line within a pop up when the width exceeds without resorting to a scroll bar

Presently, my breadcrumb has a scrollable wrap with text overflowhttps://i.sstatic.net/dhllv.png I want to make the overflowed text continue on the next line. How can I achieve this? The CSS code I am using for the image attached is as follows: .breadcrumb ...

Toggle the hamburger menu using JavaScript

How can I close my hamburger menu when clicking a link for one page navigation? The menu is functioning properly, but I need a way to close it. Unfortunately, I have limited knowledge of JS. I only have the HTML and CSS for this: HTML in index.html file ...

Selection determines the value of two fields

This form has predefined values that are used to create a link, but the issue is that these values vary depending on the location. Can you assist me with this problem? <input type="radio" id="iconapp1" name="department" value="1250"/><label for ...

What is the reason for the malfunction of input :: - webkit-slider-thumb and input :: - moz-slider-thumb?

Designing a compact slider for enhancing user experience not limited to webkit browsers requires utilizing a scss template such as input { width: 100%; -webkit-appearance: none; -moz-appearance: none; appearance: none; height: 1vm ...

Utilize Jquery to insert the text into the input or textarea field

<div class="ctrlHolder"> <label for="" id="name.label">Name</label> <input name="name" id="name" type="text" class="textInput small" /> <p class="formHint">Please enter the name of the item you are submitting</p> </di ...

Obtaining the class value using the getAttribute function

Is there a way to extract and store the value of the class (for example, "AAABC") in a variable? I've attempted various keywords with the getAttribute method, but have had no success. Using terms like "class" returned "gwt-Label", while others yielded ...

Establishing a class for wp_nav_menu

Is there a way to transform the following code: <ul class="ulStyle"> <li class="liStyle"> <div class="first"> <div class="second"> menu1 </div> </div> </li> </ul> into wp_nav_menu? I'm struggling with ...

Initiate the transmission of numerous files immediately following a specified URL

It's interesting how websites like Facebook are able to directly send their .js and .css files when you visit the site. Most "normal" sites typically send back the index.html or index.php first, followed by the necessary .js and .css files later on. ...

Ways to enlarge the parent container and reveal a concealed child element upon hovering without impacting neighboring containers

Currently, I am diligently working on the company service boxes and have a particular need... When hovering over: 1. The parent div should scale up and acquire box shadow without impacting the neighboring service boxes (it should appear to stand out above ...

How about having one row with five divs of equal width, each with a margin-right of 20px?

Is there a way to achieve 5 floating divs on one row with a 20px margin-right between each, except for the last-child? This is the desired structure: <div class="f-item pull-left">1</div> <div class="f-item pull-left">2</div> < ...