<html>
<body>
<script>
function test()
{
alert(test1.value);
}
</script>
<input type="button" id="test" value="test" οnclick="alert(test.value)">
<input type="button" id="test1" value="test1" οnclick="test()">
</body>
</html>
<html>
<body>
<script>
function test()
{
alert(test1.value);
}
</script>
<input type="button" id="test" value="test" οnclick="alert(test.value)">
<input type="button" id="test1" value="test1" οnclick="test()">
</body>
</html>