0
Hello, all right?
I saw some tutorials on the internet to put masks input in HTML, and as I am new in Javascript I imported the external library as shown below, but I must have imported wrong or used the function incorrectly, because the mask is not being applied.
Follows the code:
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.maskedinput.js" type="text/javascript"></script>
<script type="text/javascript">
[...]
jQuery(function($){
$("#inputTelefone").mask("(99) 9999-9999");
});
</script>
[...]
<input type="text" name="contato" id="inputTelefone" class="form-control">
Note: I am using the plugin Masked Input Plugin for jQuery, whose readme is available at https://github.com/digitalBush/jquery.maskedinput/blob/master/README.md
I downloaded the file jquery.maskedinput.js
from the plugin page, put in the same folder as the HTML file and worked.
jquery.js and jquery.maskedinput.js files are in the same folder as the html file?
– Wictor Chaves
No... I will try to download the files and put them in the same folder. So I come here to tell you if it worked. Thank you, Wictor!
– André Filipe da Conceição
On the Chrome or firefox console shows an error?
– Guilherme Nascimento
As you have already edited in the question, the problem was in the location of your file. I recommend reading the following question to contextualize yourself with paths: https://answall.com
– Good Bye Blue sky