Why js file is not working in HTML?
js file IS your jQuery file and you are adding your code to the top of the file, reason if you add the code into the document itself it DOES work. If that is the case then move your code to the end of the script. js file. OR you can make a separate file for your custom code and load it after the jQuery file.
It helps in the reusability of code in more than one HTML file. It allows easy code readability. It is time-efficient as web browsers cache the external js files, which further reduces the page loading time.
1+ +”2″+3 results 6 1+”2″+3 results “123” AS The unary + operator converts its operand to Number type. +”2″ is a way to cast the string “2” to the number 2 . The remain is a simple addition.
What is type in script tag?
The type attribute specifies the type of the script. The type attribute identifies the content between the <script> and </script> tags.