- Start Coding!
- The End
- Action on button-click
- Website content updates timely
- What's the secret behind Web-Maps (Google Maps) ?
- Art Galleries
- Online Messaging
- Online 2D,3D Games
How can I be one of them?
Lots of students/ people who are learning web design has a doubt, Can I be a developer someday? The answer is "Yes, you can". Only thing you need to do is...
Besides those popular methods we prefer you something special
Some Examples :
- Browser - I'm 100% sure that you have a browser. However, check whether your browser is updated to the latest versions.
- Text Editor - You can even use Notepad to do this. But, we prefer powerful sublime text. Because it makes coding easy.
- Open your text editor save the document as index.html
<html> <body> <script> alert("Hello World"); </script> </html> </body>
The <script> tag
After the script</html> </body>
- Button tag defines a button
- onclick= defines a JS code to run when the user clicks on the button
2. InternalWe have already discussed how to add a script tag internally. Unlike in-line, this scripts can define functions, variables, loops and more.
<script> alert("Hello World"); </script>
- Script tag tells the browser that this is a internal script. The use of internal scripts are different from in-line scrips. While in-line scripts are used to define something special to the element it is in, these can handle anything all over the web page.
- alert('Hello World') does the same as the previous example. But here, the code is executed as soon as the script is loaded.
- type attribute is a old standard and it's not required now. But, always use it when you add an external script to html, because still there are number of users who are using old browsers.
- src attribute is the special part when adding external scripts to the document. It defines the path of the script. (It can be either absolute path or relative path)