JSFiddle - React, Tailwind, and code Playground

by jcutrell

HTML

<div class="call">Call Me!</div><div class="call">Call Me Too!</div>

CSS

.call {
    width: 100%;
    height: 60px;
}

JavaScript

(function($, w, undefined) {

  // Collection method.
  $.fn.callClick = function(numberToCall) {
    return this.each(function(i,el) {
      var id="callclick-" + i;
        $(this).on("click", function(){
            window.location.href = "tel:" + numberToCall;
        });
      });
  };



})(jQuery, window);

$(".call").callClick("3344792341");