<form _ngcontent-c10="" action="" id="sign-in" method="post" novalidate="" data-context="sign-in" class="ng-invalid">
<div _ngcontent-c10="" class="row">
<label _ngcontent-c10="" for="username">Username</label>
<input _ngcontent-c10="" id="username" name="username" required="" type="text" value="" class="ng-untouched">
<div _ngcontent-c10="" class="error" data-sign-in-error="username error">
**field balnk**
</div>
</div>
<div _ngcontent-c10="" class="row">
<label _ngcontent-c10="" for="password">Password</label>
<input _ngcontent-c10="" id="password" minlength="6" name="password" required="" type="password" value="" class="ng-invalid">
<div _ngcontent-c10="" class="alert-error">
<div _ngcontent-c10="" data-sign-in-error"="password-error">
**password insufficient length**
</div>
</div>
</div>
每当数据登录错误可见时,我想用相应的div数据属性值打印输入id。输出应该是 username-username error,password-password-error 我不想将类用作选择器。