{"id":49784,"date":"2020-07-30T03:01:58","date_gmt":"2020-07-29T17:01:58","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=49784"},"modified":"2025-11-12T10:46:18","modified_gmt":"2025-11-12T00:46:18","slug":"button-webpage-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/button-webpage-primer-tutorial\/","title":{"rendered":"Button Webpage Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flag_quiz.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Button Webpage Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/onebigbutton.jpg\" title=\"Button Webpage Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Button Webpage Primer Tutorial<\/p><\/div>\n<p>Further to the recent <a title='Button Versus Input Type Equals Button Primer Tutorial' href='#bvitebpt'>Button Versus Input Type Equals Button Primer Tutorial<\/a> we know that &#8230;<\/p>\n<ul>\n<li>a webpage&#8217;s body element can have mouse or touch events associated with it to perform co-ordinate logic &#8230; but &#8230;<\/li>\n<li>there are some &#8220;framing&#8221; features an entire body element&#8217;s innerHTML shoved into a nested button element&#8217;s innerHTML<\/li>\n<\/ul>\n<p> &#8230; offers, and perhaps surprisingly, a lot of HTML and Javascript and CSS work that had little in its design that relied on  hierarchy (of events, or otherwise), specifically, can still &#8230;<\/p>\n<ul>\n<li>perform as it used to do &#8230; top priority for any integration (but adding something) thinking &#8230; as well as &#8230;<\/li>\n<li>adding those possibilities for mouse or touch logic for parts of the webpage that you normally place no importance on with the original design &#8230; largely &#8220;whitespace&#8221;<\/li>\n<\/ul>\n<p>To test this, <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flag_quiz.html-GETME\" rel=\"noopener\">we cloned<\/a> the web application of <a target=\"_blank\" title='Emoji Circuit Quiz Animated Emoji Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/emoji-circuit-quiz-animated-emoji-tutorial\/' rel=\"noopener\">Emoji Circuit Quiz Animated Emoji Tutorial<\/a> to arrive at the resultant <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flag_quiz.html-GETME\" rel=\"noopener\">flag_quiz.html<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flag_quiz.html\" rel=\"noopener\">live run<\/a> link you could also try below &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/flag_quiz.html\" style=\"width:100%;height:800px;\"><\/p>\n<p>Interesting, huh?!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/button-webpage-primer-tutorial\/' rel=\"noopener\">Button Webpage Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='bvitebpt'>Previous relevant <a target=\"_blank\" title='Button Versus Input Type Equals Button Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/button-versus-input-type-equals-button-primer-tutorial\/' rel=\"noopener\">Button Versus Input Type Equals Button Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_vs_input_type_button.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Button Versus Input Type Equals Button Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/path_to_improvement.jpg\" title=\"Button Versus Input Type Equals Button Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Button Versus Input Type Equals Button Primer Tutorial<\/p><\/div>\n<p>It&#8217;s an &#8230;<\/p>\n<blockquote><p>\noh, by the way\n<\/p><\/blockquote>\n<p> &#8230; day for us today!  We&#8217;re poets <font size=3>and for the life of me <font size=2>we don&#8217;t know it<\/font> <font size=1>(well, you had to be there, &#8216;ay!)<\/font><\/p>\n<p>We have a &#8220;proof of concept&#8221; idea we wanted to prove.   We don&#8217;t, around here, often use the HTML button element, and perhaps you are not the same, and do not need to read on.  In the back of my mind I knew the difference between the &#8230;<\/p>\n<ul>\n<li>input type=button element uses the <i>value<\/i> attribute as the one to one with how it displays &#8230; but <font size=2>tee, hee<\/font> <font size=1>(well, you had to be there)<\/font> &#8230;<\/li>\n<li>button element uses an <i>innerHTML<\/i> property (a bit like <i>textarea<\/i> and less like <i>div<\/i>) as the one to one with how it displays<\/li>\n<\/ul>\n<p> &#8230; and of course up to now we got by <font size=2>(perhaps stupidly <\/font><font size=1>(well, you had to be there)<\/font><font size=2>)<\/font> not making use of the &#8220;verticality&#8221; (as we find so pleasing with <i>textarea<\/i> quite often) talents of using the <i>innerHTML<\/i> property of an element.<\/p>\n<p>Our <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_vs_input_type_button.html\" title=\"Click picture\" rel=\"noopener\">&#8220;proof of concept&#8221; web application<\/a> &#8220;email address&#8221; usage &#8230;<\/p>\n<ul>\n<li>defaults an &#8220;email address&#8221; via window.<a target=\"_blank\" title='Window object sessionStorage property' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp' rel=\"noopener\">localStorage<\/a> &#8230; ahead of &#8230;<\/li>\n<li> displaying within an HTML form whose purpose it is to open the email client via the clicking of an &#8220;a&#8221; &#8220;mailto:&#8221; link <i>href<\/i> attribute filled in appropriately &#8230;\n<ol>\n<li>button + <i>a<\/i> element &#8220;button&#8221;<\/li>\n<li>button + <i>div contenteditable=true<\/i> element &#8220;button&#8221;<\/li>\n<li>input type=submit (but you can think type=button for most intents and purposes)<\/li>\n<\/ol>\n<\/li>\n<li>the last of which can be programmatically clicked by the others (and we actually might hide that <i>input type=submit<\/i> along the way) &#8230; the interest being that &#8230;<\/li>\n<li>either button scenario above is capable of gleaning the email address (with the div embedding avoiding any Javascript prompt popups) &#8230; and &#8230;<\/li>\n<li>if valid email address store back into window.<a target=\"_blank\" title='Window object sessionStorage property' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp' rel=\"noopener\">localStorage<\/a> (ready for another re-entry into the web application and saving time, perhaps)<\/li>\n<\/ul>\n<p> &#8230; and you can try out the workings of the HTML\/Javascript <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_vs_input_type_button.html_GETME\" title=\"button_vs_input_type_button.html\" rel=\"noopener\">button_vs_input_type_button.html<\/a> below &#8230;<\/p>\n<p><iframe style=\"width:100%;height:400px;\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_vs_input_type_button.html\"><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49761' onclick='var dv=document.getElementById(\"d49761\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/button\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49761' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d49784' onclick='var dv=document.getElementById(\"d49784\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/body\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d49784' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Further to the recent Button Versus Input Type Equals Button Primer Tutorial we know that &#8230; a webpage&#8217;s body element can have mouse or touch events associated with it to perform co-ordinate logic &#8230; but &#8230; there are some &#8220;framing&#8221; &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/button-webpage-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[112,174,2442,2463,342,380,400,452,564,576,1525,609,2533,2415,812,860,861,997,1986,2232,2024,2940,1294,1319,3035,1418],"class_list":["post-49784","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-attribute","tag-button","tag-contenteditable","tag-default","tag-div","tag-email","tag-event","tag-form","tag-hierarchy","tag-html","tag-innerhtml","tag-input","tag-line-feed","tag-localstorage","tag-mouse","tag-onblur","tag-onclick","tag-programming","tag-proof-of-concept","tag-property","tag-session","tag-stoppropagation","tag-touch","tag-tutorial","tag-vertical","tag-webpage"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49784"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=49784"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49784\/revisions"}],"predecessor-version":[{"id":70561,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/49784\/revisions\/70561"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=49784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=49784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=49784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}