Hi I want to shorten this: document.write("")
.
Instead i made my function:
function myFunc() {
document.write()
}
and I want that ill be able to modify it like this: myFunc("hello world")
but it did not work.
Hi I want to shorten this: document.write("")
.
Instead i made my function:
function myFunc() {
document.write()
}
and I want that ill be able to modify it like this: myFunc("hello world")
but it did not work.
Your function needs to take an argument. Right now, you're trying to pass it one, but it doesn't take any, then you call document.write()
with no arguments, so it doesn't write anything. You can add a parameter like this:
function myFunc(s)
{
document.write(s);
}