I am trying to get the value of the pre tag. I inserted the value based upon a drop down into the pre tag. How would I grab the content of the <pre>
and put it into the <input>
? I can grab the content, but am struggling setting it as value for the <input>
. Below, I have an example of what I have done.
JQUERY
var $temp = $('#Changeinfo').text();
alert($temp);
$('#Details') = $temp;
HTML
<div class="form-group">
<label class="control-label" for="Details">Details</label>
<div contenteditable="false" name="DetailID" id="DetailID"><pre
value="26" id="Changeinfo"> Do this based on selection
</pre>
</div>
<input class="form-control" type="text" id="Details" name="Details" value="">
<span class="text-danger field-validation-valid" data-valmsg-for="Details" data-valmsg-replace="true"></span>
</div>