HTML Tags | Adding Scripts in HTML


Adding Scripts in HTML(i.e. JavaScript, Action script and others) requires the use of opening and closing <script> tags. The script is entered between theses tags.

Here is an example:
<script>
//this is just an example for adding scripts
$(document).ready(function(){
$(‘h1’).click(function(){
$(this).addclass(‘.animate’)
});
});
</script>

To included external script files we have to included the ‘src’ attribute in the script tags like so


<script src=http:/faqwebdevelopmenet.js type=”text/javascript”></script>

In the above HTML code the ‘src’ attribute specifies the source location of the script file and type attribute specifies the type of script being used. (Note: in HTML5 you don’t need to specify the type attribute the browsers will automatically understand the type of script).   

Comments

Popular posts from this blog

How to Open QR Codes

Jim Henson predicted the end of the world

Mega Giveaway! (Today only!!!)