【发布时间】:2020-04-01 18:22:22
【问题描述】:
我试图找到某种方法来按类选择所有表单输入。
<form action="" class="registerForm">
<input type="text" name="loginInput" class="registerInputField">
<input type="email" name="emailInput" class="registerInputField">
<input type="password" name="passwordInput" class="registerInputField">
<input type="password" name="confirmPasswordInput" class="registerInputField">
<input type="submit" value="Register">
<input type="submit" value="Cancel">
</form>
我试过了:`
input.registerInputField{}
.registerForm > input[type=text]{}
input[type=text].registerInputField{}
我阅读了一些与此相关的主题,但没有用。 我会很高兴向我展示一些可以找到答案的资料或书籍。
【问题讨论】:
-
HTMLElement.getElementsByTagName('input') -
@AdrianSolarczyk:你没看错,但那是 JavaScript。