I have a very long form and inside it I have a specific button to import others section of the form inside the HTML.
I'm importing this new section using this code:
$.get( "nuovotaglio.html", function( data ) {
//console.log(data);
$( ".newElement" ).html( data );
console.log(this);
});
};
I need before to import this section to add an ID to a specific tag to one of this element. This piece of code of the imported section
<div class="optionTaglioCorto">
<div class="col-md-10 col-md-offset-2 form-inline">
<div class='col-md-8 prezzoAllign'>
<label class="titoloPiega">PREZZO:</label>
<select class="form-control-2 box3 mySelectBox" id="optionTaglioCorto"style="width: 220px">
<option value="0">INSERIRE PREZZO</option>
<option value="1">A PARTIRE DA</option>
<option value="2">PREZZO DA_ A_ </option>
</select>
</div>
<div class="col-md-3">
<button type="button" class="btn btn-lg bottoneCss6">OK</button>
</div>
</div>
<div class="col-md-8 col-md-offset-2 form-inline">
<div class=" col-md-5 option1 optionsInput hidden">
<label class="titoloPiega">Da:</label>
<input type="text"class="form-control value borderBottomInputField"
id="nomeSalone" placeholder="VALUE">
</div>
<div class="col-md-5 option2 optionsInput hidden">
<label class="titoloPiega">A:</label>
<input type="text" class="form-control value borderBottomInputField"
id="nomeSalone" placeholder="VALUE">
</div>
</div>
</div>
I need before to call the function nuovotaglio(), to add some id inside this file. Can someone help me?