Jquery .append is not working in firefox or safari but .val does.
Interestingly the same code works fine in IE.
code:
<head>
<link rel="stylesheet" type="text/css" href=" https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script type = "text/javascript">
$(document).ready(function () {
$("#notes").change(function () {
$('#notes').val($('#notes').val() + "Test1");
$('#notes').append('Test2');
});
});
</script>
<textarea rows="10" name="Notes1" id="notes" style="width: 100%" ><?php
if (isset($_SESSION['order'])) {
echo $_SESSION['order'][0]['tNotes'];
}
</textarea>
So the above code works fine with both Test1 and Test2 being added to the textarea in Internet explorer BUT only the .val works Test1 in FF/safari and .append does not.
Why is this? any help or alternatives to get an equivalent (appends text to the place that was edited and not just to the bottom)