Writing JavaScript in the HTML page
To write JavaScript code in the HTML page, we use the tag<script> </ script> use attribute type = "text / javascript".
example
Result
Hello World
document.write is a JavaScript code that it has a minute for us to be able to write articles for display on the Browser.
How to write JavaScript code with older Browser
Browser legacy code that can not process JavaScript code, it will show them on the Browser. To protect it, we should use your comment HTML code grab JavaScript.
example
document.write is a JavaScript code that it has a minute for us to be able to write articles for display on the Browser.
How to write JavaScript code with older Browser
Browser legacy code that can not process JavaScript code, it will show them on the Browser. To protect it, we should use your comment HTML code grab JavaScript.
example
Writing JavaScript code in an external HTML page
If you want to run the same JavaScript code on multiple pages without having to write the same code of every page you can write JavaScript code in a separate file by file extension. js.
Note :
In file JavaScript can not have <script> . For any page if you want to use the JavaScript file that is used the tag <script> by attribute src attribute src is the name of the JavaScript file.






0 comments:
Post a Comment