Stuck on this Problem?

Email Signature Maker

Tutorial

I’ll be sharing with you this simple “Email Signature Maker“ project I’ve done for my client before. After this tutorial, you will be able to recreate this base from what you need and want. Suppose you are going to use this for your company emails. In that case, all of the images you’re going to use must be uploaded to your company’s hosting server and it should be running in a secure sockets layer or have an SSL certificate. If not, your emails will be sent directly to the receiver’s spam folder.

Below is the screenshot of what it’s going to look like,

Before we begin I am expecting you have a piece of knowledge of HTML. Ok so first let’s begin with the standard HTML format.

				
					<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Cessto Signature Generator</title>
    </head>
    <body> <script data-no-optimize="1">!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).LazyLoad=e()}(this,function(){"use strict";function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,a=arguments[e];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function i(t){return e({},it,t)}function o(t,e){var n,a="LazyLoad::Initialized",i=new t(e);try{n=new CustomEvent(a,{detail:{instance:i}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(a,!1,!1,{instance:i})}window.dispatchEvent(n)}function l(t,e){return t.getAttribute(gt+e)}function c(t){return l(t,bt)}function s(t,e){return function(t,e,n){e=gt+e;null!==n?t.setAttribute(e,n):t.removeAttribute(e)}(t,bt,e)}function r(t){return s(t,null),0}function u(t){return null===c(t)}function d(t){return c(t)===vt}function f(t,e,n,a){t&&(void 0===a?void 0===n?t(e):t(e,n):t(e,n,a))}function _(t,e){nt?t.classList.add(e):t.className+=(t.className?" ":"")+e}function v(t,e){nt?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")}function g(t){return t.llTempImage}function b(t,e){!e||(e=e._observer)&&e.unobserve(t)}function p(t,e){t&&(t.loadingCount+=e)}function h(t,e){t&&(t.toLoadCount=e)}function n(t){for(var e,n=[],a=0;e=t.children[a];a+=1)"SOURCE"===e.tagName&&n.push(e);return n}function m(t,e){(t=t.parentNode)&&"PICTURE"===t.tagName&&n(t).forEach(e)}function a(t,e){n(t).forEach(e)}function E(t){return!!t[st]}function I(t){return t[st]}function y(t){return delete t[st]}function A(e,t){var n;E(e)||(n={},t.forEach(function(t){n[t]=e.getAttribute(t)}),e[st]=n)}function k(a,t){var i;E(a)&&(i=I(a),t.forEach(function(t){var e,n;e=a,(t=i[n=t])?e.setAttribute(n,t):e.removeAttribute(n)}))}function L(t,e,n){_(t,e.class_loading),s(t,ut),n&&(p(n,1),f(e.callback_loading,t,n))}function w(t,e,n){n&&t.setAttribute(e,n)}function x(t,e){w(t,ct,l(t,e.data_sizes)),w(t,rt,l(t,e.data_srcset)),w(t,ot,l(t,e.data_src))}function O(t,e,n){var a=l(t,e.data_bg_multi),i=l(t,e.data_bg_multi_hidpi);(a=at&&i?i:a)&&(t.style.backgroundImage=a,n=n,_(t=t,(e=e).class_applied),s(t,ft),n&&(e.unobserve_completed&&b(t,e),f(e.callback_applied,t,n)))}function N(t,e){!e||0<e.loadingCount||0<e.toLoadCount||f(t.callback_finish,e)}function C(t,e,n){t.addEventListener(e,n),t.llEvLisnrs[e]=n}function M(t){return!!t.llEvLisnrs}function z(t){if(M(t)){var e,n,a=t.llEvLisnrs;for(e in a){var i=a[e];n=e,i=i,t.removeEventListener(n,i)}delete t.llEvLisnrs}}function R(t,e,n){var a;delete t.llTempImage,p(n,-1),(a=n)&&--a.toLoadCount,v(t,e.class_loading),e.unobserve_completed&&b(t,n)}function T(o,r,c){var l=g(o)||o;M(l)||function(t,e,n){M(t)||(t.llEvLisnrs={});var a="VIDEO"===t.tagName?"loadeddata":"load";C(t,a,e),C(t,"error",n)}(l,function(t){var e,n,a,i;n=r,a=c,i=d(e=o),R(e,n,a),_(e,n.class_loaded),s(e,dt),f(n.callback_loaded,e,a),i||N(n,a),z(l)},function(t){var e,n,a,i;n=r,a=c,i=d(e=o),R(e,n,a),_(e,n.class_error),s(e,_t),f(n.callback_error,e,a),i||N(n,a),z(l)})}function G(t,e,n){var a,i,o,r,c;t.llTempImage=document.createElement("IMG"),T(t,e,n),E(c=t)||(c[st]={backgroundImage:c.style.backgroundImage}),o=n,r=l(a=t,(i=e).data_bg),c=l(a,i.data_bg_hidpi),(r=at&&c?c:r)&&(a.style.backgroundImage='url("'.concat(r,'")'),g(a).setAttribute(ot,r),L(a,i,o)),O(t,e,n)}function D(t,e,n){var a;T(t,e,n),a=e,e=n,(t=It[(n=t).tagName])&&(t(n,a),L(n,a,e))}function V(t,e,n){var a;a=t,(-1<yt.indexOf(a.tagName)?D:G)(t,e,n)}function F(t,e,n){var a;t.setAttribute("loading","lazy"),T(t,e,n),a=e,(e=It[(n=t).tagName])&&e(n,a),s(t,vt)}function j(t){t.removeAttribute(ot),t.removeAttribute(rt),t.removeAttribute(ct)}function P(t){m(t,function(t){k(t,Et)}),k(t,Et)}function S(t){var e;(e=At[t.tagName])?e(t):E(e=t)&&(t=I(e),e.style.backgroundImage=t.backgroundImage)}function U(t,e){var n;S(t),n=e,u(e=t)||d(e)||(v(e,n.class_entered),v(e,n.class_exited),v(e,n.class_applied),v(e,n.class_loading),v(e,n.class_loaded),v(e,n.class_error)),r(t),y(t)}function $(t,e,n,a){var i;n.cancel_on_exit&&(c(t)!==ut||"IMG"===t.tagName&&(z(t),m(i=t,function(t){j(t)}),j(i),P(t),v(t,n.class_loading),p(a,-1),r(t),f(n.callback_cancel,t,e,a)))}function q(t,e,n,a){var i,o,r=(o=t,0<=pt.indexOf(c(o)));s(t,"entered"),_(t,n.class_entered),v(t,n.class_exited),i=t,o=a,n.unobserve_entered&&b(i,o),f(n.callback_enter,t,e,a),r||V(t,n,a)}function H(t){return t.use_native&&"loading"in HTMLImageElement.prototype}function B(t,i,o){t.forEach(function(t){return(a=t).isIntersecting||0<a.intersectionRatio?q(t.target,t,i,o):(e=t.target,n=t,a=i,t=o,void(u(e)||(_(e,a.class_exited),$(e,n,a,t),f(a.callback_exit,e,n,t))));var e,n,a})}function J(e,n){var t;et&&!H(e)&&(n._observer=new IntersectionObserver(function(t){B(t,e,n)},{root:(t=e).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))}function K(t){return Array.prototype.slice.call(t)}function Q(t){return t.container.querySelectorAll(t.elements_selector)}function W(t){return c(t)===_t}function X(t,e){return e=t||Q(e),K(e).filter(u)}function Y(e,t){var n;(n=Q(e),K(n).filter(W)).forEach(function(t){v(t,e.class_error),r(t)}),t.update()}function t(t,e){var n,a,t=i(t);this._settings=t,this.loadingCount=0,J(t,this),n=t,a=this,Z&&window.addEventListener("online",function(){Y(n,a)}),this.update(e)}var Z="undefined"!=typeof window,tt=Z&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),et=Z&&"IntersectionObserver"in window,nt=Z&&"classList"in document.createElement("p"),at=Z&&1<window.devicePixelRatio,it={elements_selector:".lazy",container:tt||Z?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"litespeed-loading",class_loaded:"litespeed-loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},ot="src",rt="srcset",ct="sizes",lt="poster",st="llOriginalAttrs",ut="loading",dt="loaded",ft="applied",_t="error",vt="native",gt="data-",bt="ll-status",pt=[ut,dt,ft,_t],ht=[ot],mt=[ot,lt],Et=[ot,rt,ct],It={IMG:function(t,e){m(t,function(t){A(t,Et),x(t,e)}),A(t,Et),x(t,e)},IFRAME:function(t,e){A(t,ht),w(t,ot,l(t,e.data_src))},VIDEO:function(t,e){a(t,function(t){A(t,ht),w(t,ot,l(t,e.data_src))}),A(t,mt),w(t,lt,l(t,e.data_poster)),w(t,ot,l(t,e.data_src)),t.load()}},yt=["IMG","IFRAME","VIDEO"],At={IMG:P,IFRAME:function(t){k(t,ht)},VIDEO:function(t){a(t,function(t){k(t,ht)}),k(t,mt),t.load()}},kt=["IMG","IFRAME","VIDEO"];return t.prototype={update:function(t){var e,n,a,i=this._settings,o=X(t,i);{if(h(this,o.length),!tt&&et)return H(i)?(e=i,n=this,o.forEach(function(t){-1!==kt.indexOf(t.tagName)&&F(t,e,n)}),void h(n,0)):(t=this._observer,i=o,t.disconnect(),a=t,void i.forEach(function(t){a.observe(t)}));this.loadAll(o)}},destroy:function(){this._observer&&this._observer.disconnect(),Q(this._settings).forEach(function(t){y(t)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){var e=this,n=this._settings;X(t,n).forEach(function(t){b(t,e),V(t,n,e)})},restoreAll:function(){var e=this._settings;Q(e).forEach(function(t){U(t,e)})}},t.load=function(t,e){e=i(e);V(t,e)},t.resetStatus=function(t){r(t)},Z&&function(t,e){if(e)if(e.length)for(var n,a=0;n=e[a];a+=1)o(t,n);else o(t,e)}(t,window.lazyLoadOptions),t});!function(e,t){"use strict";function a(){t.body.classList.add("litespeed_lazyloaded")}function n(){console.log("[LiteSpeed] Start Lazy Load Images"),d=new LazyLoad({elements_selector:"[data-lazyloaded]",callback_finish:a}),o=function(){d.update()},e.MutationObserver&&new MutationObserver(o).observe(t.documentElement,{childList:!0,subtree:!0,attributes:!0})}var d,o;e.addEventListener?e.addEventListener("load",n,!1):e.attachEvent("onload",n)}(window,document);</script></body>
</html>

				
			

For the form, we’ll be using bootstrap and FontAwesome for the icons.

Put these lines inside the HEAD section.

				
					<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <link data-optimized="1" href="https://cesstowebsolutions.com/wp-content/litespeed/css/2110e24e24492d9e84a582ae1b103fc9.css?ver=03fc9" rel="stylesheet" id="bootstrap-css">

				
			

This is for fontawesome. Put this inside the HEAD section as well.

				
					<link data-optimized="1" rel="stylesheet" href="https://cesstowebsolutions.com/wp-content/litespeed/css/bf71fc11e3bea7a9f8ec23743b159ba4.css?ver=59ba4">
				
			

DESIGNING THE FORM

Normally I go to bootstrap documentation, for reference. So, if you want another approach to designing your form, be sure to check it out.

Put these lines inside the body.

				
					<div class="bg-light">
    <article>
        <h4 class="mt-3 text-center">CessTo Email Signature Maker</h4>
        <p class="text-center">Just fill up all the fields</p>
        <hr>
        <form>
            <div class="container">
                <div class="row">
                    <div class="col-md-6">
                        Column 1 
                    </div>
                    <div class="col-md-6">
                        column 2
                    </div>
                </div>
            </div>
        </form>
    </article>
</div>


				
			

For the first column,

				
					<div class="form-group input-group">
    <div class="input-group-prepend"> 
        <span class="input-group-text"> <i class="fa fa-user"></i> </span>
    </div>
    <input name="fname" id="fname" class="form-control" placeholder="Full name" type="text">
</div>

<div class="form-group input-group">
    <div class="input-group-prepend"> 
        <span class="input-group-text"> <i class="fas fa-suitcase"></i> </span>
    </div>
    <input name="position" id="position" class="form-control" placeholder="Position" type="text">
</div>

<div class="form-group input-group">
    <div class="input-group-prepend"> 
        <span class="input-group-text"> <i class="fa fa-building"></i> </span>
    </div>
    <input name="cname" id="cname" class="form-control" placeholder="Company name" value="CessTo Web Solutions" type="text">
</div>

<div class="form-group input-group">
    <div class="input-group-prepend"> <span class="input-group-text"> <i class="fas fa-map-marker-alt"></i> </span>
    </div>
    <input name="address" id="address" class="form-control" placeholder="Address" type="text" value="123 cessto Avenue, wonder City, Philippines 1234">
</div>

				
			

For the second column,

				
					<div class="form-group input-group">
    <div class="input-group-prepend"> <span class="input-group-text"> <i class="fa fa-envelope"></i> </span>
    </div>
    <input name="email" id="email" class="form-control" placeholder="Email address" type="email">
</div>

<div class="row">
    <div class="col-md-8">
        <div class="form-group input-group">
            <div class="input-group-prepend"> <span class="input-group-text"> <i class="fa fa-phone"></i> </span>
            </div>
            <input name="pnumber" id="pnumber" class="form-control" placeholder="Phone number" type="text">
        </div>
    </div>
    <div class="col-md-4">
        <input name="plocalnumber" id="plocalnumber" class="form-control" placeholder="Local" type="text">
    </div>
</div>

<div class="row">
    <div class="col-md-8">
        <div class="form-group input-group">
            <div class="input-group-prepend"> <span class="input-group-text"> <i class="fas fa-fax"></i> </span>
            </div>
            <input name="fnumber" id="fnumber" class="form-control" placeholder="Fax number" type="text">
        </div>
    </div>
    <div class="col-md-4">
        <input name="fnumber" id="flocalnumber" class="form-control" placeholder="Local" type="text">
    </div>
</div>
<div class="form-group input-group">
    <div class="input-group-prepend"> <span class="input-group-text"> <i class="fas fa-mobile-alt"></i> </span>
    </div>
    <input name="mnumber" id="mnumber" class="form-control" placeholder="Cellphone / Mobile Number" type="text">
</div>

				
			

At this point, you should now have this,

DESIGNING THE SIGNATURE

Now next is to do the format of the signature. Here is what I want to achieve.

And here’s the HTML code.

				
					<div class="container">
    <div class="row">
        <div class="col-md-6">

            <div id="selectThisText">
                <table width="550" border="0">
                    <tbody>
                        <tr>
                            <td style="padding-right:0px; padding-bottom:10px; width:130px;" width="130">
                                <img decoding="async"  width="120" data-src="be-newlogo.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="be-newlogo.png" width="120"></noscript>
                                <br>
                                <br>
                                <a href="https://www.facebook.com/cesstowebsolutions" target="_blank"><img decoding="async"  style="width:23px;" data-src="facebook.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="facebook.png" style="width:23px;"></noscript></a>
                                <a href="https://www.youtube.com/user/cesstoweb" target="_blank"><img decoding="async"  style="width:23px;" data-src="youtube.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="youtube.png" style="width:23px;"></noscript></a>
                                <a href="https://twitter.com/cesstoweb" target="_blank"><img decoding="async"  style="width:23px;" data-src="twitter.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="twitter.png" style="width:23px;"></noscript></a>
                                <a href="https://www.linkedin.com/in/cesstowebsolutions/" target="_blank"><img decoding="async"  style="width:23px;" data-src="linkedin.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="linkedin.png" style="width:23px;"></noscript></a>                      
                                <a href="https://www.google.com.ph/maps/place/Rizal+Park+-+North/@14.5844868,120.9796101,17z/data=!3m1!4b1!4m5!3m4!1s0x3397ca214a3d8bef:0x264724196efed847!8m2!3d14.5844868!4d120.9818041" target="_blank"><img data-lazyloaded="1" data-placeholder-resp="512x512" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgc3R5bGU9ImZpbGw6I2NmZDRkYjtmaWxsLW9wYWNpdHk6IDAuMTsiLz48L3N2Zz4=" width="512" height="512" decoding="async" data-src="https://drive.google.com/uc?export=view&id=16qVuzLL8OkAz0bHJxsGWSMstgnpxXDPB" style="width:23px;"><noscript><img width="512" height="512" decoding="async" src="https://drive.google.com/uc?export=view&id=16qVuzLL8OkAz0bHJxsGWSMstgnpxXDPB" style="width:23px;"></noscript></a>
                            </td>
                            <td style="border-left: #BAA355 solid 6px; padding-left:20px !important; padding-bottom:10px;" width="10">
                            </td>
                            <td width="330">
                                <p style="margin:0px; padding:0px; text-transform:uppercase; font-size:16px; font-weight:bold;" id="fnameTxt"><br></p>
                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="positionTxt"><br></p>
                                <p style="margin:0px; padding:0px;">&nbsp;<br></p>
                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px; font-weight:bold;" id="cnameTxt" margin="0" padding="0">Cessto Web Solutions<br></p>
                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px; color:#007bff;" id="emailTxt"><br></p>

                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="pnumberHolder"><span id="pnumberTxt"></span> <span style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="plocalnumberTxt"></span></p>
                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="fnumberHolder"><span id="fnumberTxt" class="fnumberTxt"></span> <span style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="flocalnumberTxt"></span></p>
                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="mnumberHolder"><span style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="mnumberTxt" class="mnumberTxt"><br></span></p>

                                <p style="margin:0px; padding:0px; color:#495057; font-size:12px;" id="addressTxt">123 cessto Avenue, wonder City, Philippines 1234<br></p>
                                <p style="margin:0px; padding:0px;"><a href="https://cesstowebsolutions.com/" target="_blank" style="font-size:12px; color:#007bff;">www.cesstowebsolutions.com</a><br></p>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table width="550" border="0">
                <tbody>
                    <tr style="margin:10px 0; padding:10px 0;">
                        <td colspan="3" height="10"> </td>
                            
                    </tr><tr style="margin:10px 0; padding:10px 0;">
                        <td colspan="3" style="border-top:#d9dadb solid 2px; padding-top:10px; color:#bfc2c5; font-size:11px;">
                            DISCLAIMER: The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email by mistake, please notify the sender immediately and do not disclose the contents to anyone or make copies thereof. 
                        </td>
                    </tr>
                </tbody>
                </table>
            </div>

        </div>
        <button id="copyText" class="btn btn-primary btn-block copy-btn">Copy signature</button>
    </div>
</div>
 
				
			

Don’t forget to change the information on the social media icons and the google map.

Alright, the idea is to get the data from the input fields and display it on the signature we just created. There are so many ways to accomplish it but what I want is to get those data in real-time as you can see on the demo page.

That can be possible using jQuery. To learn more about it, visit w3schools.

First, add this inside your header

				
					<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
				
			

And add this at the bottom of the HTML code just before the </body>.

				
					<script type="text/javascript">$(function() {      
        $('#fname').keyup(function() {
            $('#fnameTxt').text($(this).val());
        });

        $('#position').keyup(function() {
            $('#positionTxt').text($(this).val());
        });

        $('#cname').keyup(function() {
            $('#cnameTxt').text($(this).val());
        });    

        $('#email').keyup(function() {
            $('#emailTxt').text($(this).val());
        });

        $('#pnumber').keyup(function() {
            $('#pnumberTxt').text('P ' + $(this).val());
            if($('#pnumber').val().length == 0) {
                $('#pnumberTxt').hide();
                $('#plocalnumberTxt').hide();           
            } else {
                $('#pnumberTxt').show();
                $('#plocalnumberTxt').show();               
            } 
        });

        $('#plocalnumber').keyup(function() {
            $('#plocalnumberTxt').text('Local ' + $(this).val());
            if($('#plocalnumber').val().length == 0) {
                $('#plocalnumberTxt').hide();
            } else {
                $('#plocalnumber').show();
            }       
        });    

        $('#fnumber').keyup(function() {
            $('#fnumberTxt').text('F ' + $(this).val());
            if($('#fnumber').val().length == 0) {
                $('#fnumberTxt').hide();
                $('#flocalnumberTxt').hide();
            } else {
                $('#fnumberTxt').show();
                $('#flocalnumberTxt').show();               
            }       
        });

        $('#flocalnumber').keyup(function() {
            $('#flocalnumberTxt').text('Local ' + $(this).val());
            if($('#flocalnumber').val().length == 0) {
                $('#flocalnumberTxt').hide();           
            } else {
                $('#flocalnumberTxt').show();
            }
        });

        $('#mnumber').keyup(function() {
            $('#mnumberTxt').text('M ' + $(this).val());
            if($('#mnumber').val().length == 0) {
                $('#mnumberTxt').hide();
            } else {
                $('#mnumberTxt').show();
            }
        });

        $('#address').keyup(function() {
            $('#addressTxt').text($(this).val());
        });
    });</script> 
				
			

In this project, we are going to use the keyup event. The keyup() is an inbuilt method in jQuery which occurs when a keyboard key is released. The keyup() method triggers the keyup event or attaches a function to run when a keyup event occurs.

Look at this line;

				
					$('#fname').keyup(function() {
    $('#fnameTxt').text($(this).val());
});

				
			

and

				
					<p style="margin:0px; padding:0px; text-transform:uppercase; font-size:16px; font-weight:bold;" id="fnameTxt"><br></p>
				
			

So basically, what it does is it will grab the characters you typed in the input field that has the id ”fname” and put it the <p> tag that has the id “fnameTxt” in real-time.

Now what’s left is the button once clicked should copy the entire signature.

Put this script at the bottom of your HTML code just before the closing </body> tag.

				
					<script type="text/javascript">function SelectText(element) {

        var doc = document
            , text = doc.getElementById(element)
            , range, selection
        ;    
        if (doc.body.createTextRange) {
            range = document.body.createTextRange();
            range.moveToElementText(text);
            range.select();
            document.execCommand("copy");
        } else if (window.getSelection) {
            selection = window.getSelection();        
            range = document.createRange();
            range.selectNodeContents(text);
            selection.removeAllRanges();
            selection.addRange(range);
            document.execCommand("copy");
        }
    }

    $(function() {
        $('#copyText').click(function() {
            SelectText('selectThisText');
        });
    $('#selectThisText').click(function() {
            SelectText('selectThisText');
        });
    });</script> 
				
			

That will do the trick. Now all you need to do is upload everything on your server and update the path of every image you used.

				
					<img decoding="async"  style="width:23px;" data-src="https://yoursite.com/folder-name/facebook.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="https://yoursite.com/folder-name/facebook.png" style="width:23px;"></noscript>
<img decoding="async"  style="width:23px;" data-src="https://yoursite.com/folder-name/youtube.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="https://yoursite.com/folder-name/youtube.png" style="width:23px;"></noscript>
<img decoding="async"  style="width:23px;" data-src="https://yoursite.com/folder-name/twitter.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="https://yoursite.com/folder-name/twitter.png" style="width:23px;"></noscript>
<img decoding="async"  style="width:23px;" data-src="https://yoursite.com/folder-name/linkedin.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="https://yoursite.com/folder-name/linkedin.png" style="width:23px;"></noscript> 
<img decoding="async"  style="width:23px;" data-src="pin.png" class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="><noscript><img decoding="async" src="pin.png" style="width:23px;"></noscript></a>

				
			

If you like this tutorial, please leave a rating by clicking the stars below or send me a message if you have a question regarding this tutorial. I will appreciate it if you also share this on your Facebook, Twitter, or LinkedIn. Someone in your circle might also be needing this. 

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Rate this:

5/5 - (1 vote)

Related Post