javascript - How to grab all Inputs with Number type -


i have several numerical inputs

<input type='number' id='input one'> 

scattered throughout html file hundreds of lines of code. have different ids. need set min attribute 0. have other types on inputs on page, can't use

inputs=document.getelementsbytagname(); 

i need grab inputs type='number' attribute, , change min attribute. have for-loop rigged , ready, need way grab ones

type='number' 

any ideas? help. note: vanilla javascript code only, please.

call getelementsbytagname , use if check whether type number:

var elements = document.getelementsbytagname('input');  for(var i=0; i<inputs.length; i++) {     if(inputs[i].type == 'number') {         inputs[i].min = 0;     } } 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -