I testing out some things, combining html and javascript. Right now I'm trying to make a button do something when the user clicks it.
Fx
<head>
<script type="text/javascript">
function popup()
{
confirm ("Welcome!");
}
</script>
</head>
Plus the button:
<body>
<button onclick="popup()">Try it</button>
</body>
This works out very well and the popup windows appears. Now when I for example want to print a line when clicking the button, I'm just replacing "confirm" with "console.log", wich doesnt work...
What am i doing wrong, and how would i make the button print a simple line of text?
Thanks!