<html>
<head>
<title>HTest Script</title>
<link rel="stylesheet" type="text/css" href="test.css" />
<HTA:APPLICATION
ID="objHTAHelpomatic"
APPLICATIONNAME="Test Script"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
</head>
<SCRIPT Language="VBScript">
Function SetFontColor(strID, strColor)
'Variable Declaration
Dim objDoc, objEm, objForm
'Variable Setting
'Function Body
Set objEm = document.getElementById(strID)
Set objForm = document.forms(0).elements
objForm(0).hasError = "True"
alert(objForm(0).hasError) 'it should work
objEm.style.color = strColor
End Function
</SCRIPT>
<body>
<h1 id="normalTxt" >Hello World </h1>
<input TYPE=BUTTON VALUE="change color to green" name="button1" onClick='Call SetFontColor("normalTxt", "green")'>
<br />
<form nane="firstForm" >
Input: <input type="text" name=firstInput id="firstInput" />
</form>
</body>
</html>
|