calling a function
I am currently trying to call a function that will insert a style in my document but when it is called it reloads the document and makes it blank. Is there a way to keep the current text there. I read something about document.open but I am not quite sure how to use it. Here is my current code.
function style1() {
document.write('<link type="text/css" href="style1.css" REL="STYLESHEET">');
}
<a href="javascript:style1()">SOME</a>
Jack Michaelson posted this at 12:56 — 4th July 2000.
He has: 1,733 posts
Joined: Dec 1999
What you're trying to do is not possible.
The section of a HTML-page.
A document.write cannot write something in the -section so your function is not usable.
I must say that I'm curious: Why do you wanna have this kinda function??
Jack
Shakespeare: onclick || !(onclick)
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.