Copying Code From Inspect Element In Google Chrome
Answer :
Right click on the particular element (e.g. div
, table
, td
) and select the copy as html.
In earlier versions of Chrome we could simply select and copy an element (with Ctrl+C or Cmd+C) and then paste it inside an element by selecting it and then paste (with Ctrl+V or Cmd+V). It's not possible in the latest versions though (I'm running Chrome 58.0.3029.110) and it has set me up many times since then.
Instead of using the commands for copy and paste, we now have to right click the element -> Copy -> Copy Element and then right click the element that we want to append the copied element to -> Copy -> Paste Element.
I don't understand why the short commands are deactivated but at least it's still possible to do it in a more inconvenient way.
Click on the line or element you want to copy. Copy to clipboard. Paste.
The only tricky thing is if you click on a line, you get everything that line includes if it was folded. For example if you click on a div, and copy, you get everything that the div includes.
You can also get only what you want by Right Clicking, and select 'Edit as HTML'. This will make that section essentially text, with none of the folding activated. You can then select, copy and paste the relevant bits.
Comments
Post a Comment