- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Click to call – function
Hello
I want to create a “Click to call” function in my html page. Please help how I can create this.
Thanks
If you’re using jQuery:
https://api.jquery.com/on/
For example:
$('#my-element').on('click', myFunction);
If you want to use straight up JavaScript:
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener
Plenty of examples there. For plain JS, your code might need to look different depending on what browsers you need to support.
Maybe I’m crazy but I don’t think they’re asking how to call a function on click, but a “click-to-call” capability similar to LivePerson http://www.liveperson.com/liveengage/engagement/voice
If that is the case, it’s not something you’re probably going to build yourself, but instead find a service that can provide that capability for you.
Wow. Yeah that might be it. Totally different story. Can’t help you there. :)
What about putting your number down as @shaneisme suggested or just creating a simple contact form that allows your users to submit their phone number which is then emailed to you to follow up on?
ok, so google voice actually offers a neat plugin to do this for you.
you can see an example here: http://goo.gl/8RXtUY