5
I need to know how to give Ctrl c in the contents of a div when clicking on it. In this case it will have multiple Ivs, and it will take the contents of the div clicked.
I found some things on the internet but wanted something simple. Simply through the onclick pick up the content from the div.
It can be Javascript or Jquery. (Anyone serves, give it to work)
It doesn’t have to work on all browsers, just put the javascript command that copies (Ctrl + c). Because I believe it can help in the community.
Obs: I would like to be presented with a solution that is not using the technique of Clipboard
Grateful...
What exactly do you want to do with the copied content? You will use it on the same page or on another different page?
– Erlon Charles
I don’t need to go into detail, I just want to copy the content.
– Felipe Jorge
I need a quick answer, so don’t bother telling me it’s duplicate. I need to use the Ctrl c command when you click a div. I was very specific. It is not copying content to another div or elsewhere, it is literally the Ctrl C command that is what makes the question different. Please answer my question. Don’t disturb the growing community.
– Felipe Jorge
This issue is being discussed at the goal: http://meta.pt.stackoverflow.com/q/4040/3635
– Guilherme Nascimento
What @Erloncharles means is that if it’s just the data transfer inside itself browser then there may be a simpler solution (no need to involve the clipboard). But if you want to paste from/to external applications, it’s more complicated. No one is trying to "mess with" you, no, it’s just the more context can give about your problem, better the ability of the community to help you. This attitude of yours is only hurting yourself.
– mgibsonbr
@mgibsonbr is just that, this question is very interesting and better understand the need help in the resolution.
– Erlon Charles
I’m going to use this to copy contents to an iframe. With ready answers and default. But I don’t want another solution.
– Felipe Jorge
And how does this command not work on all browsers? I want to know.
– Felipe Jorge
You want to copy the text from the div or the formatting as well?
– Guilherme Nascimento
I saw that you requested removal of the site publication, and I was wondering if there was any particular reason to request it. Because in fact, duplicates are welcome since created organically, just like yours was, so if that’s just the reason, it’s not necessary to remove it from the site.
– Math
That’s why I created another similar question. So this would be a duplicate of the duplicate. The other question I think is more organized. (This I wanted to exclude) Because the other one already has answer.
– Felipe Jorge
@Felipejorge It is good to keep duplicates on the site (as long as they are marked as duplicates), because they help other people to get to the relevant content. And this question came to receive a plausible answer, and with 3 votes already. We moderators chose to keep it, ok?
– bfavaretto
Okay, I just indicated to remove it because she was giving too much headache.
– Felipe Jorge