{"id":1029,"date":"2021-04-16T20:40:12","date_gmt":"2021-04-16T11:40:12","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=1029"},"modified":"2021-05-04T16:17:38","modified_gmt":"2021-05-04T07:17:38","slug":"post-1029","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/04\/16\/1029\/","title":{"rendered":"textarea \u3092\u53ef\u5909\u30b5\u30a4\u30ba\u3067\u5b9f\u88c5\u3059\u308b"},"content":{"rendered":"\n<p>\u3000\u554f\u3044\u5408\u308f\u305b\u30d5\u30a9\u30fc\u30e0\u3067\u4f7f\u3063\u3066\u3044\u308b textarea \u3092\u5165\u529b\u3057\u305f\u5185\u5bb9\u306b\u5408\u308f\u305b\u3066\u30b5\u30a4\u30ba\u3092\u53ef\u5909\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3000<a href=\"https:\/\/qiita.com\/tsmd\/items\/fce7bf1f65f03239eef0\">\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u30b5\u30a4\u30ba\u304c\u53ef\u5909\u3059\u308b &lt;textarea&gt; \u3092\u7d20\u6575\u306b\u5b9f\u88c5\u3059\u308b<\/a>\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002html \u3068 css\u3001javascript \u306e\u5408\u308f\u305b\u6280\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u305d\u308c\u305e\u308c\u306e\u5185\u5bb9\u306f\u3001\u53c2\u8003\u30b5\u30a4\u30c8\u306b\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u305e\u308c\u3092\u8a18\u8ff0\u3059\u308b\u5834\u6240\u304c\u554f\u984c\u3067\u3059\u3002\u306f\u3058\u3081\u3001css \u3068 javascript \u3092 html \u306e head \u90e8\u306b\u66f8\u3044\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3060\u3068\u3046\u307e\u304f\u884c\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u554f\u984c\u306f\u3001javascript \u306e\u5b9f\u884c\u4f4d\u7f6e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3000javascript \u3092\u5b9f\u884c\u3059\u308b\u4f4d\u7f6e\u304c textarea \u3092\u4f5c\u6210\u3057\u305f\u5f8c\u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u3067\u304d\u308c\u3070\u3001body \u3092\u9589\u3058\u308b\u76f4\u524d\u306b\u5b9f\u884c\u3059\u308b\u306e\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002javascript \u3067\u64cd\u4f5c\u3059\u308b\u8981\u7d20\u304c\u4f5c\u6210\u3055\u308c\u305f\u5f8c\u3067\u5b9f\u884c\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u8a18\u8ff0\u3059\u308b\u9806\u756a\u3068\u3057\u3066\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><span style=\"font-size: 17px\" class=\"font-size\">head \u90e8\u306b css \u3092\u66f8\u304f<\/span><\/li><li><span style=\"font-size: 17px\" class=\"font-size\">body \u90e8\u306b textarea \u3092\u66f8\u304f<\/span><\/li><li><span style=\"font-size: 17px\" class=\"font-size\">body \u90e8\u306e\u6700\u5f8c\u306b javascript \u3092\u66f8\u304f<\/span><\/li><\/ol>\n\n\n\n<p>\u3000\u3053\u308c\u3067\u671f\u5f85\u901a\u308a\u306b\u3001 textarea \u306e\u5185\u5bb9\u306b\u5f93\u3063\u3066\u9ad8\u3055\u304c\u5909\u308f\u3063\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3000\u307b\u307c\u3001\u53c2\u8003\u30b5\u30a4\u30c8\u306e\u307e\u307e\u3067\u3059\u304c\u3001\u5ff5\u306e\u70ba\u3001\u78ba\u8a8d\u3067\u4f5c\u3063\u305f html \u3092\u63d0\u793a\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"file\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ja\"&gt;\n&lt;head&gt;\n&lt;title&gt;\u53ef\u5909 textarea&lt;\/title&gt;\n&lt;meta charset=\"utf-8\"&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=yes\"&gt;\n&lt;style&gt;\n  .ft {\n    position: relative;\n    font-size: 1rem;\n    line-height: 1.8;\n  }\n  .ft_dummy {\n    overflow: hidden;\n    visibility: hidden;\n    box-sizing: border-box;\n    padding: 5px 15px;\n    min-height: 120px;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n    overflow-wrap: break-word;\n    border: 1px solid;\n  }\n  .ft_textarea {\n    position: absolute;\n    top: 0;\n    left: 0;\n    box-sizing: border-box;\n    padding: 5px 15px;\n    width: 100%;\n    height: 100%;\n    background-color: transparent;\n    border: 1px solid #b6c3c6;\n    border-radius: 4px;\n    color: inherit;\n    font: inherit;\n    letter-spacing: inherit;\n    resize: none;\n    background-color: #ffffff;\n  }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;p&gt;\u30b3\u30e1\u30f3\u30c8\uff1a\n    &lt;div class=\"ft\"&gt;\n      &lt;div class=\"ft_dummy\" aria-hidden=\"true\"&gt;&lt;\/div&gt;\n      &lt;textarea id=\"ft\" class=\"ft_textarea\" placeholder=\"\u30b3\u30e1\u30f3\u30c8\u3092\u3069\u3046\u305e\"&gt;&lt;\/textarea&gt;\n    &lt;\/div&gt;\n  &lt;\/p&gt;\n  &lt;script&gt;\n    function flexTextarea(el) {\n      const dummy = el.querySelector('.ft_dummy');\n      el.querySelector('.ft_textarea').addEventListener('input', e =&gt; {\n        dummy.textContent = e.target.value + '\\u200b';\n      });\n    }\n    document.querySelectorAll('.ft').forEach(flexTextarea);\n  &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u554f\u3044\u5408\u308f\u305b\u30d5\u30a9\u30fc\u30e0\u3067\u4f7f\u3063\u3066\u3044\u308b textarea \u3092\u5165\u529b\u3057\u305f\u5185\u5bb9\u306b\u5408\u308f\u305b\u3066\u30b5\u30a4\u30ba\u3092\u53ef\u5909\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u3000\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u30b5\u30a4\u30ba\u304c\u53ef\u5909\u3059\u308b &lt;textarea&gt; \u3092\u7d20\u6575\u306b\u5b9f\u88c5\u3059\u308b\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002html \u3068  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1029","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=1029"}],"version-history":[{"count":5,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1029\/revisions"}],"predecessor-version":[{"id":1034,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1029\/revisions\/1034"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=1029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=1029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=1029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}