P
Philip WATTS
Can anyone help a beginner?
I am trying to set up a situation where by activating a link, a text phrase
above the link changes.
I am calling a function that uses a document.write statement, but the text
is shown in a new window (replacing the current one) rather than on the same
page.
The code is below.
Thanks for your time
Phil
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
text=new String
start=new String
one=new String
two=new String
text="initial text value"
function phase1(){
text="phase one text from function"
document.write(text)
}
function phase2(text){
text="phase two text from function"
document.write(text)
}
</script>
</head>
<body>
<div name="texthere"> Text is supposed to go here</div>
<script language="Javascript">
document.write(text)
</script>
<a href="java1.html#" onClick="phase1()">link1</a>
<a href="java1.html#"onClick="phase2()">link2</a>
</body>
</html>
I am trying to set up a situation where by activating a link, a text phrase
above the link changes.
I am calling a function that uses a document.write statement, but the text
is shown in a new window (replacing the current one) rather than on the same
page.
The code is below.
Thanks for your time
Phil
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
text=new String
start=new String
one=new String
two=new String
text="initial text value"
function phase1(){
text="phase one text from function"
document.write(text)
}
function phase2(text){
text="phase two text from function"
document.write(text)
}
</script>
</head>
<body>
<div name="texthere"> Text is supposed to go here</div>
<script language="Javascript">
document.write(text)
</script>
<a href="java1.html#" onClick="phase1()">link1</a>
<a href="java1.html#"onClick="phase2()">link2</a>
</body>
</html>