online Editor
val() | Attributes - jQuery リファレンス
val( function ) - 5 - jQueryのval( function )のサンプルです。
<!DOCTYPE HTML> <html lang="ja"> <head> <meta charset="UTF-8"> <title>sample1</title> </head> <body> <input type="text" value="AA"> <input type="text" value="BB"> <button>click</button> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $("button").click(function(){ $("input").val(function(index,value){ return index+"["+value+"]"; }); }); </script> </body> </html>
HTMLを反映する >>
タグ:
jQuery
val()
Web Creative Park