回答編集履歴
2
情報の追加。
test
CHANGED
@@ -12,6 +12,14 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
```JavaScript
|
16
|
+
|
17
|
+
var data = /^\d{7}$/.test(pcode[0].value);
|
18
|
+
|
19
|
+
```**動くサンプル:**[https://jsfiddle.net/tL27qy94/](https://jsfiddle.net/tL27qy94/)
|
20
|
+
|
21
|
+
|
22
|
+
|
15
23
|
【RegExp.prototype.test() - JavaScript | MDN】
|
16
24
|
|
17
25
|
[https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)
|
1
情報の追加。
test
CHANGED
@@ -5,3 +5,13 @@
|
|
5
5
|
【<input>: 入力欄 (フォーム入力) 要素 - HTML: HyperText Markup Language | MDN】
|
6
6
|
|
7
7
|
[https://developer.mozilla.org/ja/docs/Web/HTML/Element/Input#value](https://developer.mozilla.org/ja/docs/Web/HTML/Element/Input#value)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
あと、testはRegExpのメソッドなので書き方が違います。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
【RegExp.prototype.test() - JavaScript | MDN】
|
16
|
+
|
17
|
+
[https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)
|