Future Star Enterprises
ボタンを押すと現在から1ヶ月後に新技術などで脚光を浴びる日本の上場企業の名称を表示します。
<!DOCTYPE html>
<html>
<head>
<title>Future Star Enterprises</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Future Star Enterprises</h1>
<p>ボタンを押すと現在から1ヶ月後に新技術などで脚光を浴びる日本の上場企業の名称を表示します。</p>
<button onclick="showCompany()">企業を表示</button>
<div id="result"></div>
<script>
function showCompany() {
// 現在から1ヶ月後の日付を計算
let date = new Date();
date.setMonth(date.getMonth() + 1);
// 企業リストを定義
let companyList = [
{ name: "エムスリー", reason: "医療系アプリ開発で需要が高まる" },
{ name: "ソフトバンク", reason: "5Gの普及で通信業界が注目される" },
{ name: "ユニクロ", reason: "新型コロナウイルス感染症の影響でネット通販需要が増加" },
{ name: "オリンパス", reason: "医療機器の需要が高まる" },
{ name: "斎藤工業", reason: "自動運転関連技術の開発で期待される" },
];
// ランダムな企業を選択
let randomIndex = Math.floor(Math.random() * companyList.length);
let companyName = companyList[randomIndex].name;
let companyReason = companyList[randomIndex].reason;
// 結果を表示
let result = document.getElementById("result");
result.innerHTML = `<p>${date.getFullYear()}年${date.getMonth()+1}月に脚光を浴びるのは「${companyName}」です。</p><p>理由:${companyReason}</p>`;
}
</script>
</body>
</html>