{"id":827,"date":"2021-06-26T12:32:03","date_gmt":"2021-06-26T12:32:03","guid":{"rendered":"https:\/\/coru2.com\/blog\/?p=827"},"modified":"2021-06-26T12:32:04","modified_gmt":"2021-06-26T12:32:04","slug":"%e7%b4%a0%e3%81%aejavascript%e3%81%a7%e4%b8%80%e8%a6%a7%e3%81%ae%e8%a6%81%e7%b4%a0%e3%81%8b%e3%82%89%e3%80%81%e3%82%af%e3%83%aa%e3%83%83%e3%82%af%e3%81%97%e3%81%9f%e8%a6%81%e7%b4%a0%e3%82%92%e6%b6%88","status":"publish","type":"post","link":"https:\/\/coru2.com\/blog\/archives\/827","title":{"rendered":"\u7d20\u306eJavascript\u3067\u4e00\u89a7\u306e\u8981\u7d20\u304b\u3089\u3001\u30af\u30ea\u30c3\u30af\u3057\u305f\u8981\u7d20\u3092\u6d88\u3059"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/coru2.com\/blog\/wp-content\/uploads\/2021\/06\/GIF-2021-06-26-20-51-24.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"363\" src=\"https:\/\/coru2.com\/blog\/wp-content\/uploads\/2021\/06\/GIF-2021-06-26-20-51-24.gif\" alt=\"\" class=\"wp-image-833\"\/><\/a><\/figure>\n\n\n\n<p>\u975ejQuery\u3067\u4e00\u89a7\u306e\u8981\u7d20\u304b\u3089\u3001\u30af\u30ea\u30c3\u30af\u3057\u305f\u8981\u7d20\u3092\u6d88\u3059\u65b9\u6cd5\u306e\u30e1\u30e2\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u969b\u306e\u30b3\u30fc\u30c9<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;!--HTML--&gt;\n  &amp;lt;div class=&quot;item_box&quot;&gt;\n    &amp;lt;p&gt;Die katze ist sehr sch\u00f6n.&amp;lt;\/p&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;x&amp;lt;\/div&gt;\n  &amp;lt;\/div&gt;\n  &amp;lt;div class=&quot;item_box&quot;&gt;\n    &amp;lt;p&gt;Die Eule ist sehr sch\u00f6n.&amp;lt;\/p&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;x&amp;lt;\/div&gt;\n  &amp;lt;\/div&gt;\n  &amp;lt;div class=&quot;item_box&quot;&gt;\n    &amp;lt;p&gt;Der Hunt ist sehr sch\u00f6n.&amp;lt;\/p&gt;\n    &amp;lt;div class=&quot;item&quot;&gt;x&amp;lt;\/div&gt;\n  &amp;lt;\/div&gt;\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ JS\nconst target_item_name = &#039;.item&#039;;\/\/ \u3053\u306eclass\u540d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u6d88\u3059\nconst target_item_wrap_name = &#039;.item_box&#039;;\/\/ \u6d88\u3057\u305f\u3044\u4e00\u89a7\u306eclass\u540d\n\n\/\/ \u6d88\u3059\u51e6\u7406\ndocument.querySelectorAll(target_item_name).forEach((element) =&gt;{\n  element.addEventListener(&#039;click&#039;, (event) =&gt; {\n    \/\/ \u30af\u30ea\u30c3\u30af\u3057\u305f\u8981\u7d20\u306e\u89aa\u8981\u7d20\u3092\u524a\u9664\n    event.target.closest(target_item_wrap_name).remove();\n  });\n});\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ jQuery\n$(function(){\n  $(&#039;.item&#039;).click(function(){\n    $(this).parent().remove();\n  });\n});\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">memo<\/h2>\n\n\n\n<p>jQuery\u3070\u304b\u308a\u3092\u4f7f\u3046\u6848\u4ef6\u306b\u632f\u308a\u56de\u3055\u308c\u308b\u4e2d\u3001\u7a81\u5982\u964d\u308a\u304b\u304b\u308bVue.js\u6848\u4ef6\u3002<br>\u5df1\u306e\u5b9f\u529b\u3092\u904e\u4fe1\u3057\u3059\u304e\u305f\u6280\u8853\u8005\u306b\u5f85\u3061\u53d7\u3051\u308b\u306e\u306f\u3001\u5e7e\u591a\u306eUndefined\u5730\u7344\u3067\u3042\u3063\u305f\u3002<br>\u4e00\u3064\u3001\u307e\u305f\u4e00\u3064\u3068\u3001\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u304f\u5f7c\u3089\u306b\u5f85\u3061\u53d7\u3051\u308b\u306e\u306f\u3001\u5e0c\u671b\u304b\u3001\u7834\u6ec5\u304b\u3002<\/p>\n\n\n\n<p>\u6b21\u56de\u3001React\u6848\u4ef6\u3002<\/p>\n\n\n\n<p>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u7d42\u7aef\u306f\u3001\u8ab0\u3082\u30d4\u30ea\u30aa\u30c9\u3092\u6253\u305f\u306a\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u975ejQuery\u3067\u4e00\u89a7\u306e\u8981\u7d20\u304b\u3089\u3001\u30af\u30ea\u30c3\u30af\u3057\u305f\u8981\u7d20\u3092\u6d88\u3059\u65b9\u6cd5\u306e\u30e1\u30e2\u3002 \u5b9f\u969b\u306e\u30b3\u30fc\u30c9 memo jQuery\u3070\u304b\u308a\u3092\u4f7f\u3046\u6848\u4ef6\u306b\u632f\u308a\u56de\u3055\u308c\u308b\u4e2d\u3001\u7a81\u5982\u964d\u308a\u304b\u304b\u308bVue.js\u6848\u4ef6\u3002\u5df1\u306e\u5b9f\u529b\u3092\u904e\u4fe1\u3057\u3059\u304e\u305f\u6280\u8853\u8005\u306b\u5f85\u3061\u53d7\u3051\u308b\u306e\u306f\u3001\u5e7e\u591a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":832,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","wp-seo-meta-description":"","wp-seo-meta-robots":[]},"categories":[54,56],"tags":[],"class_list":{"0":"post-827","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-web","8":"category-javascript","9":"c-entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/posts\/827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":5,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":834,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/posts\/827\/revisions\/834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/media\/832"}],"wp:attachment":[{"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/media?parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/categories?post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coru2.com\/blog\/wp-json\/wp\/v2\/tags?post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}