var
stop =
null
;
function
funString() {
str =
'Hello World!'
document.getElementById(
'p'
).innerHTML = str;
}
funMake() {
stop = setInterval(
'funString()'
, 2000);
funStop() {
clearTimeout(stop);
window.onload =
() {
'b'
).onclick = funStop;
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
input
id
"b"
type
"button"
value
"Stop"
br
p
"p"
funMake();