ウェブページ上で、ボタンを押すと他のサイトに行くようにするための
とても基本的な構文が、どういうわけか作動しなくなっているのを発見しました。
なぜ、下記の事例(2)が動かないのか、理由を教えていただけますでしょうか。
以下のコードをご覧ください。
html
1 2<!DOCTYPE html><html> 3<head><meta charset="UTF-8"> 4<base target="_blank"> 5<STYLE > 6.f17 { font-size: 17px; } 7code { color: blue; } 8</STYLE> 9 10</head> 11<body class= "f17 " > 12 13<p> 14(1) inline script . . . 15 16<button onclick="window.location.replace( 'https://www.yahoo.com/' )" > 17go to next page 18</button> 19</p> 20 21<code> 22< button onclick="window.location.replace( 'https://www.yahoo.com/' )" > 23 go to next page 24 < /button > 25</code><br><br> 26 27<p> 28(2) inline script - no longer valid . . . 29 30<button onclick="window.location.href( 'https://www.yahoo.com/' )" > 31 go to next page ## - this used to work 32</button> 33</p> 34 35<code> 36< button onclick="window.location.href( 'https://www.yahoo.com/' )" > 37</code> 38 39</body> 40</html> 41

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。