HTML
1<!DOCTYPE html> 2<html lang="ja"> 3 <head> 4 <meta charset="utf-8"> 5 <title>Progate</title> 6 <link rel="stylesheet" href="stylesheet.css"> 7 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 8 </head> 9 <body> 10 <div class="slide-wrapper"> 11 <h2 class="slide-title"></h2> 12 </div> 13 </body> 14</html>
javascript
1class Document{ 2 constructor(subtitle,message){ 3 this.subtitle=subtitle; 4 this.message=message; 5 } 6 info(){ 7 return this.subtitle+'は'+this.message; 8 } 9} 10 11const document = new Document('チョコレート','美味しい'); 12const title=document.info(); 13 14 $('.slide-title').text(title);
こうやったらブラウザに、『チョコレートは美味しい』と表示されると思ったんですが、出力されませんでした。
なぜでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/05 07:08 編集
2018/12/05 07:09
2018/12/05 07:11