I am experimenting with HTA's and have encountered an issue while testing. Below is the code I am currently working with:
<script language="VBScript">
Public Game
Sub window_onload()
Game="Help"
sGame.body.InnerHTML=Game
sName.body.InnerHTML=Game
End Sub
Sub strTest
Game="Test"
End Sub
</script>
<body bgcolor="#42732D">
<div style="position:relative;
text-align:center;
top:45px;">
<span id = "sName" style="text-align:center;
font-family:Small Fonts;
font size:65px;
z-index:1;
color:#1C2433">
Yes
</span>
<span id = "sGame"
style="text-align:center;
position:absolute;
left:-4px;
font-family:Small Fonts;
font size:65px;
z-index:15;
color:#1094AF">
</span>
</div>
<input type="button" style="font-family:Small Fonts; font size:30px; color: white; background-color:grey" value="Testing" name="bTest" onclick="strTest">
</body>
My goal is to assign the same variable to two spans as a workaround to style the text differently within each span (to create a 3D effect). However, when executing strTest
, which should update the spans' text to reflect the current value of the variable Game
, nothing seems to change. How can I dynamically alter the content of a span using a variable?