<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<iframe id="myiframe"></iframe>
</body>
</html>
<script src = "261.js"></script>
document.addEventListener("DOMContentLoaded", docReady);
function docReady()
{
document.getElementById('myiframe').contentDocument.write('<html><body><h3>текст</h3></body></html>');
document.getElementById('myiframe').contentDocument.close();
document.getElementById('myiframe').contentDocument.getElementsByTagName('h3')[0].addEventListener('click', showIt);
}
function showIt(e)
{
console.log(e.target);
}
document.addEventListener('DOMContentLoaded', docReady);
function docReady()
{
let data = JSON.stringify({
"modelName": "TrackingDocument",
"calledMethod": "getStatusDocuments",
"methodProperties":
{
"Documents":
[
{
"DocumentNumber": id,
"Phone": ""
}
]
}
});
data = 'data=' + data + '&apiKey=' + '';
let response = fetch(
'https://api.novaposhta.ua/v2.0/json/',
{
method: 'POST',
headers:
{
'Content-Type': 'application/json; charset=utf-8'
},
body: data
}
)
.then(function(response)
{
response.text().then(function(text)
{
data = text;
});
});
}
<form name="myForm" action="send_my.php" method="post">
<table>
<tr>
<td><select name="num">
<option>Выбрать</option>
<option value="10">1 бонус</option>
<option value="20">2 бонуса</option>
<option value="30">3 бонуса</option>
<option value="40">4 бонуса</option>
<option value="50">5 бонусов</option>
</select></td>
<td><select name="num">
<option>Выбрать</option>
<option value="10">1 супербонус</option>
<option value="20">2 супербонуса</option>
<option value="30">3 супербонуса</option>
<option value="40">4 супербонуса</option>
<option value="50">5 супербонусов</option>
</select></td>
<td><select name="num">
<option>Выбрать</option>
<option value="10">1 мегабонус</option>
<option value="20">2 мегабонуса</option>
<option value="30">3 мегабонуса</option>
<option value="40">4 мегабонуса</option>
<option value="50">5 мегабонусов</option>
</select></td>
</tr>
</table>
</form>
<input type = "text">
<script src = "112.js"></script>
document.getElementsByTagName('input')[0].value = 100;
document.getElementsByTagName('select')[0].onchange = calculateSum;
document.getElementsByTagName('select')[1].onchange = calculateSum;
document.getElementsByTagName('select')[2].onchange = calculateSum;
function calculateSum(e)
{
document.getElementsByTagName('input')[0].value = document.getElementsByTagName('input')[0].value *
Number(e.target.options[e.target.selectedIndex].value);
}