1
Good,
Below I have a clipping of an HTML page, where there is a Tspinner component, and I would like to change the attributes "data-min"
and "data_max"
when necessary.
- There are several Tspinner in html.
- I don’t have the
"id"
component since it is generated by PHP. - To
"class"
is generic or is used by all Tspinner. - The attribute
"name"
is unique in this case"name=REG_MAXIMO"
.
<div class="fb-inline-field-container form-line" style="display: inherit;vertical-align:top;;width: 200px">
<div class="input-group spinner" data-trigger="spinner">
<input class="form-control tfield" widget="tspinner" title="" name="REG_MAXIMO" value="4" type="text" data-min="0" data-max="100" data-step="1" style="text-align:right;width:100%;" relwidth="100%" id="tspinner_1786988191" data-original-title="Qtde Máxima da Regra">
<div class="input-group-addon">
<a href="javascript:;" class="spin-up" data-spin="up">
<i class="fa fa-caret-up"></i>
</a>
<a href="javascript:;" class="spin-down" data-spin="down">
<i class="fa fa-caret-down"></i>
</a>
</div>
</div>
</div>
I think what you want is something like Document.querySelector('input[name=REG_MAXIMO]');
– kervincandido