Saturday, January 11, 2014

The external JavaScript file and embed it in html page.

Here first create JavaScript file and link it in HTML file.

JavaScript file js.js

function piyu()

    alert("Hello Friends"); 
}

HTML file

<html> 
<head> 
    <script type="text/javascript" src="js.js"></script> 
</head> 
<body> 
    <p>Welcome to javascripttution.blogspot.com</p> 
    <form> 
        <input type="button" value="click" onclick="piyu()"/> 
    </form> 
</body> 
</html>

No comments:

Post a Comment