我正在尝试将密码输入以下HTML代码的密码字段:
<input name="customerPassword" type="password" class="customer-password form-control ng-dirty ng-valid-required filled ng-valid ng-valid-minlength" ng-class="{
'input-error': submitted && securityForm.customerPassword.$invalid,
'filled': securityForm.customerPassword.$viewValue.length>0}" ng-minlength="7" maxlength="20" ng-model="customer.password" ng-keydown="checkEnterKey(event)" required="" autocomplete="new-password" aria-autocomplete="list">
<b class="into-input">Password</b>
<div class="ct-icon ng-hide" ng-show="securityForm.$invalid">
<div class="ct-tooltip">
<i class="fa fa-info-circle fa-lg info"></i>
<div class="tooltip">
<div class=""><p>This is the password you created when you registered for Internet Banking. </p></div>
</div>
</div>
</div>
<met-tooltip category="login" key="input-password" ng-show="securityForm.$valid" icon="check" class="valid-number met-tooltip-bg-green ng-isolate-scope"><span> <!-- ngIf: !tooltip.inline --><a ng-if="!tooltip.inline" href="javascript:void(0)" tabindex="-1" tooltip-trigger="" tooltip-placement="" tooltip-html-unsafe="<p><span style="line-height:20.8px">Password entered.</span></p>
" tooltip-popup-delay="100" class="ng-scope"> <i data-ng-click="goTo()" class="fa fa-check-circle"></i> </a><!-- end ngIf: !tooltip.inline --> <!-- ngIf: tooltip.inline --></span></met-tooltip>
<a ng-if="!tooltip.inline" href="javascript:void(0)" tabindex="-1" tooltip-trigger="" tooltip-placement="" tooltip-html-unsafe="<p><span style="line-height:20.8px">Password entered.</span></p>
" tooltip-popup-delay="100" class="ng-scope"> <i data-ng-click="goTo()" class="fa fa-check-circle"></i> </a>
请参见下面的我的VBA代码段:
Dim event_onChange As Object
Set event_onChange = ie.document.createEvent("HTMLEvents")
event_onChange.initEvent "keydown", True, False
.document.querySelector(".customer-password").dispatchEvent event_onChange
当我手动输入密码时,会出现一个小圆圈,但在运行以上VBA代码后却不会出现。使用VBA如何做到这一点?