0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

JavaScript ハンズオンpart5

Posted at

イントロダクション

JavaScriptハンズオンpart1,2,3,4閲覧いただきありがとうございます!
この記事では、以下を参考記事等を活用しながらJavaScriptのハンズオンした内容をまとめます。
書籍『改訂版 演習 Webプログラミング入門』

目次

  1. writeメソッド(ex251.html)
  2. write・alertメソッド(ex252.html)

1. writeメソッド(ex251.html)

書籍『改訂版 演習 Webプログラミング入門』4-2-5練習問題25-1のex251.htmlを作成します。

<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <title>ex251</title>
</head>
<body>
<script>
  window.document.write("100+200×8 =<br>");
  window.document.write((100 + 200 * 8) + "<br>");
  window.document.write("(100+200)×8 =<br>");
  window.document.write((100 + 200) * 8 + "<br>");
  window.document.write("文字列の100と200を足すと文字列の結合になります<br>");
  window.document.write("100" + "200" + "<br>");
</script>
</body>
</html>

以下のWebページが作成されます!
image.png

2. write・alertメソッド(ex252.html)

書籍『改訂版 演習 Webプログラミング入門』4-2-5練習問題25-2のex251.htmlを作成します。

<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>メソッド練習</title>
</head>
<script>
window.alert("一時停止");
window.document.write("OKが押されました。<br>");
</script>
<body>
</body>
</html>

以下のWebページが作成されます!
image.png
image.png

まとめ

最後までご覧いただきありがとうございます!!writeメソッドとwrite/alertメソッドを使った練習問題に取り組んでみました!次回は変数について学んでいきます!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?