Last active
August 29, 2015 14:09
-
-
Save rashita/61010c82aeb0bfa74040 to your computer and use it in GitHub Desktop.
備忘録代わりに
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//jQueryの書き方 | |
$(function(){ | |
//ここに処理を書く | |
}); | |
//実際例:メソッド | |
$(function(){ | |
$("#maintext").focus(function(){ | |
$("#side1 ,#side2").fadeOut('slow'); | |
}); | |
}); | |
//id="maintext"の要素にフォーカスが当たったら、カッコの中の処理を実行する | |
//id="side1"とid="side2"の要素をフェードアウトさせる。時間はslowで。 | |
//実際例:値の取得 | |
$(function()){ | |
var iText = $("#logtasklist").text() ; | |
var iVal = $("#logtasklist").val() ; | |
}); | |
//上記のように書けば、要素から値を取得できる。一般の要素はtextかhtmlが使える。form系の部品はval(値)となる。 | |
//実際例:値の設定 | |
$(function()){ | |
$("#logtasklist").text("私はテストテキストです。") ; | |
var hello = "hello world"; | |
$("#logtasklist").val(hello) ; | |
}); | |
//()の中に値を描き込めば、値の設定になる。 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment