{"id":958,"date":"2017-09-15T15:35:48","date_gmt":"2017-09-15T15:35:48","guid":{"rendered":"http:\/\/blog.silverterra.net\/?p=958"},"modified":"2017-09-15T15:40:24","modified_gmt":"2017-09-15T15:40:24","slug":"contenteditable-select-all-on-double-click","status":"publish","type":"post","link":"https:\/\/blog.silverterra.net\/?p=958","title":{"rendered":"contenteditable &#8211; select all on double click"},"content":{"rendered":"<blockquote><p>Goal: don&#8217;t be fool, do it easy<\/p><\/blockquote>\n<p>A have a DIV with contenteditable=&#8221;true&#8221; attribute. Like a textbox but not really. I want to select all the content with a double click on it. With jQuery like this: <\/p>\n<pre data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">\r\n  var myDIV = ...;\r\n  myDIV.on({\r\n    dblclick: function(){\r\n      \/\/ one line code coming\r\n      document.execCommand('selectAll', false, null);\r\n    }\r\n  });\r\n<\/pre>\n<p>&#8230; so do you know better than this solution? &#8230;<br \/>\nI have read many scientific solution for this problem. Don&#8217;t be fool, just do it easy&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: don&#8217;t be fool, do it easy A have a DIV with contenteditable=&#8221;true&#8221; attribute. Like a textbox but not really. I want to select all the content with a double click on it. With jQuery like this: &#8230; so do you know better than this solution? &#8230; I have read many scientific solution for this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7],"tags":[],"class_list":["post-958","post","type-post","status-publish","format-standard","hentry","category-javascript","category-jquery"],"_links":{"self":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=958"}],"version-history":[{"count":4,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/958\/revisions"}],"predecessor-version":[{"id":962,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/958\/revisions\/962"}],"wp:attachment":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}