Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
How to replace img tag with pitcure tag in editor on success?

I am trying to replace img tag with picture tag in editor.

Editor adding url like : <img src="http://localhost/news/uploads/large/6dBUlfZZBW.webp">

How can I change this :

success: function(url) {
   var image = $('<img>').attr('src','http://' +url);
   $('#summernote').summernote("insertNode", image[0]);
}

To This :

<picture>
  <source media="(min-width: 400px)" srcset="uploads/large/JS60y3eMKG.webp" type="image/webp">
  <source media="(max-width: 300px)" srcset="uploads/medium/JS60y3eMKG.webp" type="image/webp">
  <source media="(max-width: 200px)" srcset="uploads/small/JS60y3eMKG.webp" type="image/webp">
  <img src="uploads/small/JS60y3eMKG.webp" alt="test" width="200" height="200">
</picture> 

Note: all images has same names but different folders.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!