For the popping an alert box on a button click,we use the alert method that is JavaScript, right?

I haven't seen any code that surrounds the call to alert inside the `onclick` attribute in a `'<script>'` tag.