| Member with 4,030 posts. THREAD STARTER | | Join Date: May 2010 Location: Sri Lanka Experience: Advanced | |
Solved: javascript:How to take the output in the same page? have a look at the following code
<html >
<head>
<script language="javascript">
function texter()
{
var textField;
textField = txtone.value;
textFieldLength = txtone.value.length;
if (textFieldLength==0)
{
txtone.value=prompt("Please enter someting","");
}
else
{
document.write("<marquee>"+"welcome "+"<font color = 'red'>"+textField+"</font>"+" how are you?"+"</marquee>");
}
}
</script>
</head>
<body>
<input type = "text" name = "txtone" >
<input type= "button" value = "click" onclick = "texter()">
</body>
</html>
This code takes the user input and generates a marquee. But the case is it generates the marquee in a separated page, but I need it to generated in the same page where that textfield and button exists, below to them. Can anyone tell me how to do that? Please help. Any help would be much appreciated. |