How to select and delete HTML elements (tags and content) in VS Code?
P粉573809727
P粉573809727 2023-09-19 10:55:17
0
1
721

First, there is an "Emmet: Remove Tag" function, but it will only remove the wrapper for a specific tag. It does not delete the entire element including its children.

I'm looking for the same operation to be able to remove child elements at the same time. This can save a few seconds for people who frequently edit HTML.

In the example below, I want to remove the entire

    element by using Emmet or a similar command.

    <!DOCTYPE html>
    <html>
    <head>
        <title>My Dummy HTML Snippet</title>
    </head>
    <body>
        <h1>Hello, World!</h1>
        <p>This is a dummy HTML snippet with nested tags.</p>
        <div>
            <h2>A Nested Section</h2>
            <p>This is a paragraph inside a div element.</p>
            <ul>
                <li>List item 1</li>
                <li>List item 2</li>
                <li>List item 3</li>
            </ul>
        </div>
        <p>Back to the main content.</p>
    </body>
    </html>
    

P粉573809727
P粉573809727

reply all(1)
P粉005105443

Maybe this extension expand-region can solve the problem.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!