{"id":1917,"date":"2019-02-25T17:12:12","date_gmt":"2019-02-25T16:12:12","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=1917"},"modified":"2019-11-22T16:29:03","modified_gmt":"2019-11-22T15:29:03","slug":"replace-inputboxes-with-text-value","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/replace-inputboxes-with-text-value\/","title":{"rendered":"Replace inputboxes with text value"},"content":{"rendered":"\n<p>For copying text values (and not input boxes) from websites in e.g. Excel<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Array.from(document.querySelectorAll('input,textarea'))\n\t.map(e => ({e, type: e.getAttribute('type').toLowerCase()}))\n\t.filter(e => !e.type || ['text', 'email', 'number', 'password'].includes(e.type))\n\t.forEach(d => {\t\n\t\tconst i = d.e;\n\t\tconst r = i.getBoundingClientRect();\n\t\tconst e = document.createElement('pre');\n\t\te.style.display = 'inline-block';\n\t\te.style.width = `${r.width}px`;\n\t\te.style.height = `${r.height}px`;\n\t\te.appendChild(document.createTextNode(i.value));\n\t\ti.parentElement.insertBefore(e, i)\n\t\ti.parentElement.removeChild(i);\n\t});<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For copying text values (and not input boxes) from websites in e.g. Excel<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1917","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=1917"}],"version-history":[{"count":7,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1917\/revisions"}],"predecessor-version":[{"id":2920,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1917\/revisions\/2920"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=1917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=1917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=1917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}