Me and my programmer has 2 different views for what "Inline JavaScript" is.
I said inline JavaScript means JavaScript placed directly in the HTML file, without in a .JS file.
My programmer means inline JavaScript is JavaScript on 1 line, and like <button onclick="alert('test')">
I give him right in, that inline JavaScript also is "onclick='alert(...)"
because it again is like my solution #1, all JavaScript loaded in HTML and not in JS.
Who's right?
We have a HTML file, and there is <script>....</script>
JavaScript in the bottom, that is inline javascript, right?
A script
tag without a src
(ie. with code directly in the HTML document) is referred to as an inline script.
An onclick="..."
attribute is called an inline event handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With