I'm currently developing a website in HTML and I want to copy some of the code from other websites. However when I go into the inspect element feature and try to copy just part of the code it ends up copying the whole script. Is there any way I can get just part of the code from inspect element without having to copy the whole thing and cut out the bits that I don't want in dreamweaver?
-
Try double click, also see _Resources_ panel. – Sampo Sarrala - codidact.org Sep 25 '12 at 04:34
-
1How bout if wanted to copy just a few lines? – mars Sep 25 '12 at 04:37
-
1Then you would use _Resources_ panel, _Scripts_ panel or at _Elements_ panel select tag and _RMB_ => _Edit as HTML_ => select and copy what you want. – Sampo Sarrala - codidact.org Sep 25 '12 at 04:48
8 Answers
Right click on the particular element (e.g. div
, table
, td
) and select the copy as html.

- 13,652
- 14
- 67
- 96

- 1,644
- 10
- 40
- 64
-
3I don't have a `Copy as HTML` option, but I did find an `Edit as HTML` option which I could then Ctrl+A to select all and then copy and paste. Great tip! – user3738893 Feb 12 '15 at 16:22
-
1Note that this will not save the content of iframes! To copy the content of iframes you'll have to do the above for each element separately. – oriadam Jun 16 '15 at 07:53
-
1You can also just highlight the element and hit `ctrl+c` on your keyboard. – oriadam Jun 16 '15 at 07:55
-
1
-
The `Copy element` didn't work for me. Choosing `Edit as HTML` then copying the text box works for me! – Sophia Feng Mar 05 '20 at 04:03
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.

- 1,375
- 14
- 25
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.

- 8,847
- 4
- 67
- 72
If you need to copy whole page,
- got to html tag of the page.
- right click on it.
- select "copy->copy element" option

- 111
- 2
- 10
You can copy by inspect element and target the div you want to copy. Just press ctrl+c and then your div will be copy and paste in your code it will run easily.

- 27
- 1
- 6
-
1not true atm, an update must have disabled ctrl+c, giving me a headache right now as transposing one of my old websites. – Daniel Brose May 09 '17 at 23:15
-
@DanielBrose not sure if it was true in 2017, but today you can ctrl + c/ctrl + v to copy and paste elements from dev tools. – Art3mix Mar 11 '21 at 10:05
The best solution is instead of opening the inspect element -> right click -> View Page Source -> then copy the entire code.
This solution works for Chrome.

- 585
- 4
- 22
(eg: div,footer,table) Right click -> Edit as HTML
Then you can copy and paster wherever you need...
that's all enjoy your coding.....

- 1,072
- 11
- 9
you dont have to do that in the Google chrome. Use the Internet explorer it offers the option to copy the css associated and after you copy and paste select the style and put that into another file .css to call into that html which you have created. Hope this will solve you problem than anything else:)