dinamic write in page

admin

Administrator
Staff member
Hi,
first sorry for my english.
I need from javascript. This is my webpage.
I want, when I click the button "Show In Table text 2"
the script to show "text two" in my table and when I
click the button "Show In Table text 3" to show in table
"text three". Is this possible? I try to do it, but it not
work. Where is my error?

<HTML>
<HEAD>
<title>webpage</title>
<META content="text/html; charset=windows-1251"
http-equiv=Content-Type>


<SCRIPT language=javascript type="text/javascript">

dayInfo = new Array
dayInfo[1] = "text one"
dayInfo[2] = "text two"
dayInfo[3] = "text three"
dayInfo[4] = "text 4"

function ShowInTable(thisDay) {
document.tbl.place.value =
dayInfo[thisDay]
}

</script>

</HEAD>

<BODY>

<center>
MY TABLE <br>
<TABLE name=tbl border=2 cellPadding=2 cellSpacing=2>
<TBODY>
<TR>
<TD width="220" name=place height=40> </td>
</tr>
</tbody>
</table>
<br>
<Button OnClick="ShowInTable(2)">Show In Table text 2</button>
<Button OnClick="ShowInTable(3)">Show In Table text 3</button>
</center>

</BODY>
</HTML>
 
Back
Top