How to control the size of input type = "number" of arrow buttons

I am implementing an input field with a type = "number" list.

I want to adjust the size of the up arrow button and the down arrow button.

I think these buttons are so small that users might feel an awkward click movement.

I'm trying to fix this by Googling, researching the properties and selectors of this, but I couldn't get any methods, and I expect it to be because an HTML5 tag has recently been released on the numbered field.

How can I customize this size? please give me any idea. you are welcome.

Respectfully,

enter image description here

<td>
<input type="number" name="qty" value="1" name="goodsnum" onChange = "qtyChanged();">
</td>

      

+3


source to share


2 answers


Try this below.
I found it here: http://jqueryui.com/spinner/
From this related question: Increase the size of down arrow and arrow on number input, CSS, HTML



$( function() {
  var spinner = $( "#spinner" ).spinner();

  $( "#disable" ).on( "click", function() {
    if ( spinner.spinner( "option", "disabled" ) ) {
      spinner.spinner( "enable" );
    } else {
      spinner.spinner( "disable" );
    }
  });
  $( "#destroy" ).on( "click", function() {
    if ( spinner.spinner( "instance" ) ) {
      spinner.spinner( "destroy" );
    } else {
      spinner.spinner();
    }
  });
  $( "#getvalue" ).on( "click", function() {
    alert( spinner.spinner( "value" ) );
  });
  $( "#setvalue" ).on( "click", function() {
    spinner.spinner( "value", 5 );
  });

  $( "button" ).button();
} );
      

.ui-button.ui-widget.ui-spinner-button.ui-spinner-up {
  width: 40px;
  height: 30px;
  border: 1px solid black;
}

.ui-button.ui-widget.ui-spinner-button.ui-spinner-down {
  width: 40px;
  height: 30px;
  border: 1px solid black;
}

input {
  height: 45px;
}
      

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Spinner - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script src="/resources/demos/external/jquery-mousewheel/jquery.mousewheel.js"></script>
</head>
 
<p>
  <label for="spinner">Select a value:</label>
  <input id="spinner" name="value">
</p>
      

Run code


+1


source


You can interact with arrows by css.



input[type=number] {
    height: 30px;
}

input[type=number]:hover::-webkit-inner-spin-button {  
    width: 14px;
    height: 30px;
}
      

<input type="number" value="0" >
      

Run code


+3


source







All Articles