I have an HTA that is displayed when a backup routine is complete and I'd like to be able to manipulate the HTA via VBS, showing whether or not a series of folders were backed up correctly.
So, using the ID of an element within the HTA, is it possible to add a class to the element?
For example -
If result = true Then {add class 'success' to id 'result-documents'}
Here is my VBS for showing the HTA -
Shell.Run COMPLETED_MESSAGE_PATH, 0, True
And example of an element that I wish to target is as below. For example, here I'd like to add a class attribute (the class name varies) to the element with ID 'result-documents' -
<span class="list-item"><span id="result-documents"></span>Documents</span>
If the element in question doesn't have a
class
attribute already you need to create one first before you can assign a value to it:For running this code directly in an HTA just remove the IE object, because IE already is your runtime environment in that context:
If your element ID didn't have a hyphen in it (e.g.
resultsDocuments
instead ofresults-documents
) you could even use its ID directly: