ローカル変数
変数のスコープとは?
関数内の上の方で、ローカル変数として宣言しよう。
jQuery Code
$(function() {
var hello = "Hello World!";
var letsStudy = "Let's Study JavaScript!";
$("#headline").hover(function(){
$(this).text(hello);
},
function(){
$(this).text(letsStudy);
});
});