Share Selected Text with JavaScript

preview_player
Показать описание
Using JavaScript, learn how to implement a feature which gives users the option to easily share selected text, in this case to Twitter but could be any social media or even additional options such as to copy to clipboard or convert selected text-to-speech so that user can listen to it!

The feature of sharing selected text is quite common, especially in Blog sites and it helps websites gain exposure, grow traffic and increase search engine rankings!

In the first few minutes of this video, we build the structure and add the content and styling with HTML and CSS. After deciding which areas of our page should allow for sharing selected text, we proceed to JavaScript in order to access the selected text, display the share button to the appropriate position and share the selected text upon a click event over the share button.

Enjoy 🙂

Don’t forget to share, like, subscribe and would love to hear your thoughts in the comment section below!

Support the Channel 💙☕🙏

Suggested Videos:

Subscribe 💖
Рекомендации по теме
Комментарии
Автор

Thank you so much sir, this was what I was looking for, finally got it !

jineshpagaria
Автор

That was exactly what I needed, thank you! Could you also perhaps make a video on how to add an element to contain the text selected. like <b> </b>. I am creating a toolbar, in my case.

dankhnw
Автор

This is just what I need!!! Thank you so much.

eliaschen
Автор

You are incredible! Thank you very much!

kabulzhan
Автор

That's very useful! And, as usual, brilliantly explained 😉 Thank you!!

Tony-pekp
Автор

you are so calm i like you, keep up the work and never stop, you'll get to where you want to get ! <3

ProMakerDev
Автор

Absolutely amazing! Thanks for sharing this great content 💖

neo
Автор

Great video. Can you tell me how can i share text along with an image in twitter? Thanks

DevarshiDavessj
Автор

It's awesome, mind blowing... 🎉🎉🎉 Learned a lot.

ck
Автор

Can you tell how we can do same thing with touch events ? As this only works with mouse events ?
Facing issues on mobile devices

HardeepSingh-dehi
Автор

This is brilliant! Thanks for sharing :)

oLitaryMan
Автор

How to get selected text position like top, left

ManojYadav-plqs