To add javascript in webpage you have to use following syntax
<script type="text/javascript">
alert('hello developer');
</script>
Javascript in html web page can be added with script tag. In above example we have shown an alert as 'hello developer'.
To run the above code you can try on any online javascript editor and check the same