Call javascript function in web page

How to call javascript function in a web page?
e.g. Putting the following code
alert(‘test’);
in a web page will display the string “alert(‘test’);”.
No alert box appears.

ypu have to put it wurrounded by <script> tag Ej:

<script type=“text/javascript”>alert(‘test’);</script>