質問編集履歴
1
コード追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,5 +3,38 @@
|
|
3
3
|
- 親画面側のJSで、子画面のボタンの表示/非表示や、活性非活性を記載したいです。
|
4
4
|
- 子画面では、検索等の処理を行っており、親画面から制御したい項目には、静的なボタンだけでなく動的なボタンも含みます。
|
5
5
|
|
6
|
+
### 試したこと
|
7
|
+
```html
|
8
|
+
<!DOCTYPE html>
|
9
|
+
<html>
|
10
|
+
<head lang="ja">
|
11
|
+
<meta charset="UTF-8" />
|
12
|
+
<title>html1</title>
|
13
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<button id="button1" onclick="openWindow()">button1</button>
|
17
|
+
<div id="loadHtml2"></div>
|
18
|
+
<script type="text/javascript">
|
19
|
+
function openWindow(){
|
20
|
+
test = window.open("./html2.html","test");
|
21
|
+
test.document.getElementById("button2").removeAttribute("disabled");
|
22
|
+
}
|
23
|
+
|
24
|
+
</script>
|
25
|
+
</body>
|
26
|
+
</html>
|
27
|
+
```
|
28
|
+
|
29
|
+
```html
|
30
|
+
<!DOCTYPE html>
|
31
|
+
<html>
|
32
|
+
<body>
|
33
|
+
<button id="button2" disabled=disabled>button2</button>
|
34
|
+
test
|
35
|
+
</body>
|
36
|
+
</html>
|
37
|
+
```
|
38
|
+
|
6
|
-
|
39
|
+
実現可能かどうか、参考サイトなどご教示いただけると幸いです。
|
7
40
|
(調べたところ、子画面⇒親画面の操作はできますが、親画面⇒子画面の操作はできないのかと思ってます。※window.open()のオプションにも指定できないようなので)
|