{"id":1446,"date":"2018-08-07T19:22:08","date_gmt":"2018-08-07T10:22:08","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1446"},"modified":"2018-08-07T19:22:08","modified_gmt":"2018-08-07T10:22:08","slug":"this%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6id%e5%90%8d%e3%82%84class%e5%90%8d%e3%82%92%e6%8b%be%e5%be%97","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/this%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6id%e5%90%8d%e3%82%84class%e5%90%8d%e3%82%92%e6%8b%be%e5%be%97\/","title":{"rendered":"this\u3092\u4f7f\u3063\u3066ID\u540d\u3084Class\u540d\u3092\u62fe\u5f97"},"content":{"rendered":"<p>this\u3092\u4f7f\u7528\u3059\u308c\u3070<br \/>\n\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306b\u306f\u305d\u308c\u305e\u308cID\u540d\u304c\u964d\u3089\u308c\u3066\u304a\u308a\u3001\u62bc\u3057\u305f\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306eID\u540d\u3092\u5224\u5225\u3057\u3066\u3001<br \/>\n\u8868\u793a\u3055\u305b\u308b\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u8907\u6570\u3042\u308b\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u3001\u500b\u5225\u306b\u5bfe\u5fdc\u3057\u305f\u30e1\u30cb\u30e5\u30fc\u3092\u305d\u308c\u305e\u5165\u308c\u8868\u793a\u3055\u305b\u305f\u308a\u3001<br \/>\n\u30d5\u30a9\u30fc\u30e0\u3092\u6761\u4ef6\u5206\u5c90\u3067\u30e6\u30fc\u30b6\u30fc\u306b\u767b\u9332\u3055\u305b\u308b\u5185\u5bb9\u3092\u5909\u66f4\u3057\u305f\u3044\u306a\u3069\u3067\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u4f8b\u3067\u306f\u30013\u3064\u306e\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306b\u5bfe\u3057\u3066\u8868\u793a\u3055\u305b\u308b\u30e1\u30cb\u30e5\u30fc\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<pre>\r\n<p>    \r\n    <input type=\"radio\" name=\"contact\" id=\"contact_01\">\u4e00\u822c\r\n    <input type=\"radio\" name=\"contact\" id=\"contact_02\">\u6cd5\u4eba\r\n    <input type=\"radio\" name=\"contact\" id=\"contact_03\">\u305d\u308c\u4ee5\u5916\r\n<\/p>\r\n\r\n<div id=\"menu_01\">\r\n\u30e1\u30cb\u30e5\u30fc1\u306e\u5185\u5bb9\r\n<\/div>\r\n\r\n<div id=\"menu_02\">\r\n\u30e1\u30cb\u30e5\u30fc2\u306e\u5185\u5bb9\r\n<\/div>\r\n\r\n<div id=\"menu_03\">\r\n\u30e1\u30cb\u30e5\u30fc3\u306e\u5185\u5bb9\r\n<\/div>\r\n\r\n<\/pre>\n<pre>\r\n$('input').click(function() {\r\n  var val = $(this).attr('id');\r\n  \/\/ ID\u540d\u306b\u5bfe\u3057\u3001\u8868\u793a\u3059\u308b\u5185\u5bb9\u3092\u8a2d\u5b9a\u3059\u308b\u3002\r\n  if(val == \"contact_01\"){\r\n    $('menu_01').show(); \r\n    $('menu_02').hide(); \r\n    $('menu_03').hide(); \r\n  }else if(val == \"contact_02\"){\r\n    $('menu_01').hide();\r\n    $('menu_02').show(); \r\n    $('menu_03').hide(); \r\n  }else if(val == \"contact_03\"){\r\n    $('menu_01).hide();\r\n    $('menu_02').hide(); \r\n    $('menu_03').show();  \r\n  }\r\n});\r\n<\/pre>\n<p>\u4e0a\u8a18\u3067\u306f\u3001<br \/>\n\u30e6\u30fc\u30b6\u304c\u9078\u629e\u3057\u305f\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306eid\u3092 var val = $(this).attr(\u2018id\u2019); \u3067\u62fe\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306e\u3088\u3046\u306b\u3001attr\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306bid\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067this\u306eid\u5024\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>this\u3092\u4f7f\u7528\u3059\u308c\u3070 \u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306b\u306f\u305d\u308c\u305e\u308cID\u540d\u304c\u964d\u3089\u308c\u3066\u304a\u308a\u3001\u62bc\u3057\u305f\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306eID\u540d\u3092\u5224\u5225\u3057\u3066\u3001 \u8868\u793a\u3055\u305b\u308b\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u8907\u6570\u3042\u308b\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u3068\u304d\u3001\u500b\u5225\u306b\u5bfe\u5fdc\u3057\u305f\u30e1\u30cb\u30e5\u30fc\u3092\u305d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-05-06 02:23:14","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1446"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1446"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1446\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}