指定の要素数を取得
$(function(){ $("#s1Input").on("keyup",function(){ var x = $(this).val().length; $("#s1p").text(x + "文字"); }); });
$(function(){ $("#s2Btn").on("click",function(){ var y = $("input[name='s2Check']:checked").length; if(y <= 1){ $("#s2p").text("bad"); } else if(y == 2){ $("#s2p").text("good"); } else { $("#s2p").text("very good"); } }); });