I've got this html file
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<button type="button" onclick="changeText()">
Change!
</button>
<p id='change'>Camión</p> <!-- It's OK-->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="jscaracteres.js" type="text/javascript" charset="UTF-8"></script>
</body>
</html>
And this javascript function in "jscaracteres.js"
function changeText() {
var newText = "Camión 2.0"; //Camión 2.0
$("#change").html(newText);
}
If I put the function inside html, there aren't any problem with special characters, but if I have the function changeText() in a .js file when I click the button, the text change to "Camión 2.0" instead of "Camión 2.0". I don't know where is the problem.