I have a dropdown select menu with two options. Basically im using JavaScript to get the value of the selected drop down option and pasting into a text area. Here is my code:
$(document).ready(function () {
$('#pdSev').change(function () {
$('#textarea').html($("#pdSev option:selected").text());
})
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<select id="pdSev" name="pdSev">
<option selected disabled class="test">Incident Severity</option>
<option value="test">Test</option>
<option value="test2">Test2</option>
</select>
<textarea id="textarea" class="textarea is-rounded has-fixed-size" placeholder="Example"></textarea>
So far this currently works as when I select an item from the select menu, the option value gets replicated into the texture field.
However, I want the option value to be replaced by a paragraph instead of just containing a word, for example:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
What would be the best way to do something like this in JS?
TIA