Hi,
Here is my code, I wanna remove image source from HTML content.
Please provide some solution to achieve this task.
<div class="col-md-12">
@Html.Raw(item.Content)
</div>
Home / DeveloperSection / Forums / How to remove image source from html content?
Hi,
Here is my code, I wanna remove image source from HTML content.
Please provide some solution to achieve this task.
<div class="col-md-12">
@Html.Raw(item.Content)
</div>
Aryan Kumar
30-May-2023There are a few ways to remove image source from HTML content.
Using a text editor
You can use a text editor to open the HTML file and remove the image source from each image tag. To do this, find the image tag and delete the src attribute. For example, the following image tag:
Code snippet
Would be changed to:
Code snippet
Using a web browser
You can also use a web browser to remove image source from HTML content. To do this, open the HTML file in a web browser and right-click on each image. Select "Inspect Element" from the menu. This will open the browser's developer tools. In the developer tools, find the image tag and delete the src attribute. Click "Save" to save the changes to the HTML file.
Using a programming language
If you are familiar with a programming language, you can use that language to remove image source from HTML content. There are many different programming languages that can be used to do this. For example, you could use Python to write the following code:
Code snippet
This code will open the HTML file, parse it using BeautifulSoup, and then iterate through all of the image tags. For each image tag, the src attribute will be set to an empty string. The new HTML content will then be written to a new file.
Whichever method you choose, make sure to test the changes to the HTML content before you publish it.
Hemant Patel
12-Mar-2018Hi Ethan,
Follow these steps to achieve your task.
Step 1. Write below a line of code at top of the page.
Step 2. And modify your code as follows.
Hope it's helpful !!!