<form id="form">
<input id="hgjyt" name="hgjyt" type="text" value="6000" size="6" maxlength="4"><br>
<input id="dfgfd" name="dfgfd" type="text" value="7000" size="5" maxlength="5"><br>
<input id="khjg" name="khjg" type="text" value="4000" size="5" maxlength="3"><br>
<input id="ert" name="ert" type="text" value="5000" size="4" maxlength="4"><br>
<input id="fdgdf" name="fdgdf" type="text" value="1000" size="3" maxlength="4"><br>
<input id="jty" name="jty" type="text" value="2000" size="5" maxlength="4"><br>
<input id="tre" name="tre" type="text" value="3000" size="5" maxlength="2"><br>
</form>
<input type="button" onClick="a()" value="Click">
<script>
function a() {
var elems = document.getElementById("form")//.getElementsByTagName("input");
var i=0;
var str = elems.innerHTML.replace(/^[\s\S]*?(<input[^>]*?size="5"[^>]*?maxlength="4"[^>]*?>)[\s\S]*?$/ig,"$1")
alert(str)
}a()
</script>