The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Can't add text in textarea on click listener

Go down

Solved Can't add text in textarea on click listener

Post by Guest November 9th 2022, 11:14 pm

Version: AwesomeBB.

So, I created my own div, added image in it and now I made a script as well to trigger onClick event. HTML:

Code:
<div id="personal_social">
                <img src="https://i.ibb.co/fHQdty7/317731-pinterest-social-social-media-icon-20x20.png" title="Pinterest" id="pinterest_img" />
              </div>

JS code:

Code:
let pinterest_image = document.getElementById("pinterest_img");

pinterest_image.addEventListener("click", function() {
    let textarea = document.getElementById("text_editor_textarea");
textarea.value += "test";
});

For unknown reason to me, this doesn't work. Nothing happens.


Last edited by System32 on November 9th 2022, 11:21 pm; edited 1 time in total
avatar
Guest
Guest


Back to top Go down

Solved Re: Can't add text in textarea on click listener

Post by SLGray November 9th 2022, 11:16 pm

Are you trying to add a Pinterest share button to messages?   If yes, you do know there is already a share link for Pinterest, correct?


Can't add text in textarea on click listener Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 50755
Reputation : 3484
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Can't add text in textarea on click listener

Post by Guest November 9th 2022, 11:19 pm

SLGray wrote:Are you trying to add a Pinterest share button to messages?   If yes, you do know there is already a share link for Pinterest, correct?
There is share link, yes. But it doesn't give me this:

Can't add text in textarea on click listener Screen29

I only get regular link. And if there is share "Get pin embed code", it requires HTML.
avatar
Guest
Guest


Back to top Go down

Solved Re: Can't add text in textarea on click listener

Post by Guest November 9th 2022, 11:21 pm

I just realized there is button for embed code. The icon is so weird I would never clicked it. Solved. Can't add text in textarea on click listener 1f605
avatar
Guest
Guest


Back to top Go down

Solved Re: Can't add text in textarea on click listener

Post by SLGray November 9th 2022, 11:23 pm

Problem solved & topic archived.
Please read our forum rules:  ESF General Rules


Can't add text in textarea on click listener Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 50755
Reputation : 3484
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum