How to insert Javascript code into my HTML?

Asked

Viewed 63 times

-2

I want to make a mask for a form. I already have a JS code ready, but I don’t know how to insert it next to HTML.

  • 1

    As our friend Bruno Ribeiro commented. This correct more see what your javascript application does because if it is an automated function type a text that will appear it is better to put your script code inside the <head></head> more if it is a function in which the user has to press or pass the mouse put at the end before from closing the </body> tag not to slow down your website.

1 answer

0


You can create a script tag in your page header as an example below:

<script>
    document.getElementById('teste').value
</script> 

and enter your javascript code or use the tag:

<script src="<caminho do seu arquivo .js>"></script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.