{"id":5406,"date":"2026-07-16T18:17:38","date_gmt":"2026-07-16T09:17:38","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=5406"},"modified":"2026-07-16T18:17:38","modified_gmt":"2026-07-16T09:17:38","slug":"mouseenter%e3%80%81mouseleave","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=5406","title":{"rendered":"mouseenter\u3001mouseleave"},"content":{"rendered":"\n<p>css\u3067 hover \u3092\u4f7f\u7528\u3059\u308b\u3068\u30db\u30d0\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>javascript\u3092\u4f7f\u7528\u3057\u3066\u3082\u30db\u30d0\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u6307\u5b9a\u304c\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Javascript\u306e\u30db\u30d0\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u7406\u7531<\/h1>\n\n\n\n<p>css \u306e hover \u306f\u30db\u30d0\u30fc\u3057\u305f\u8981\u7d20\u306b\u306e\u307f\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5909\u66f4\u51fa\u6765\u307e\u3059\u3002<br>\u3042\u308b\u8981\u7d20\u306b\u30db\u30d0\u30fc\u3057\u305f\u6642\u306b\u3001\u5225\u306e\u8981\u7d20\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001javascript\u306e mouseenter\u3001mouseleave \u30a2\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4f8b<\/h1>\n\n\n\n<p>\u7c21\u5358\u306a mouseenter\u3001mouseleave \u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div class=&quot;sample_01&quot;&gt;\u30db\u30d0\u30fc\u3057\u3066\u4e0b\u3055\u3044\u3002&lt;\/div&gt;\n&lt;div class=&quot;sample_02&quot;&gt;\u521d\u671f\u72b6\u614b&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.sample_01, .sample_02 {\n  height: 50px;\n  width: 100px;\n  margin-top: 10px;\n}\n\n.sample_01 {\n  background-color: blueviolet;\n  color: #ffffff;\n}\n\n.sample_02 {\n  background-color: #ffd700;\n  color: #ffffff;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>Javascript<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>const sample_01 = document.querySelector(&#39;.sample_01&#39;);\nconst sample_02 = document.querySelector(&#39;.sample_02&#39;);\n\n\/\/ \u8981\u7d20\u306b\u30ab\u30fc\u30bd\u30eb\u304c\u5165\u308b\nsample_01.addEventListener(&#39;mouseenter&#39;, function (e) {\n    sample_02.style.backgroundColor = &#39;red&#39;;\n    sample_02.textContent = &#39;red&#39;;\n});\n\n\/\/ \u8981\u7d20\u304b\u3089\u30ab\u30fc\u30bd\u30eb\u304c\u5916\u308c\u308b\nsample_01.addEventListener(&#39;mouseleave&#39;, function (e) {\n    sample_02.style.backgroundColor = &#39;blue&#39;;\n    sample_02.textContent = &#39;blue&#39;;\n});<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<style>\n.sample_01, .sample_02 {\n  height: 50px;\n  width: 100px;\n  margin-top: 10px;\n}\n\n.sample_01 {\n  background-color: blueviolet;\n  color: #ffffff;\n}\n\n.sample_02 {\n  background-color: #ffd700;\n  color: #ffffff;\n}\n<\/style>\n<div class=\"sample_01\">\u30db\u30d0\u30fc\u3057\u3066\u4e0b\u3055\u3044\u3002<\/div>\n<div class=\"sample_02\">\u521d\u671f\u72b6\u614b<\/div>\n\n<script>\nconst sample_01 = document.querySelector('.sample_01');\nconst sample_02 = document.querySelector('.sample_02');\n\n\/\/ \u8981\u7d20\u306b\u30ab\u30fc\u30bd\u30eb\u304c\u5165\u308b\nsample_01.addEventListener('mouseenter', function (e) {\n    sample_02.style.backgroundColor = 'red';\n    sample_02.textContent = 'red';\n});\n\n\/\/ \u8981\u7d20\u304b\u3089\u30ab\u30fc\u30bd\u30eb\u304c\u5916\u308c\u308b\nsample_01.addEventListener('mouseleave', function (e) {\n    sample_02.style.backgroundColor = 'blue';\n    sample_02.textContent = 'blue';\n});\n<\/script>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u7279\u306b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>css\u3067 hover \u3092\u4f7f\u7528\u3059\u308b\u3068\u30db\u30d0\u30fc\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":4348,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5406","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5406"}],"version-history":[{"count":1,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5406\/revisions"}],"predecessor-version":[{"id":5407,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5406\/revisions\/5407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/4348"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}