Nitin
Nitin

Reputation: 1451

Prevent copying of html/css styles when copying from a div

When copying from a div that has applied CSS properties like font-styles and font-size to the text in them this CSS also gets copied and the pasted content is formatted as per the styles. How can we stop this behaviour, such that when you copy from a div, not matter what styles is applies only the text part gets copied to the clipboard?

Upvotes: 0

Views: 1002

Answers (1)

Kapil Kshirsagar
Kapil Kshirsagar

Reputation: 282

This is the clipboard feature which copy the style also. I think we cannot prevent this behavior by javascript. You can copy it in notepad then paste it so the style will not apply for the text.

Upvotes: 1

Related Questions