const para = document.querySelector('p');
para.onclick = function() {
alert('Owww, stop poking me!');
}
You shouldn't use presentational elements like <font>
and
<center>
.
In the above JavaScript example, para represents a paragraph element.
Select all the text with Ctrl/Cmd + A.
$ ping mozilla.org PING mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=40 time=158.233 ms