N
N
neoneel2015-11-13 18:21:22
PHP
neoneel, 2015-11-13 18:21:22

How to wrap an img tag in a div?

there is a site on joomla, materials are displayed on the main page in a short form .... some have images in the preview, some do not, the task is to find these images and wrap them in a div with a given class ... if someone tells me how to do this, I will be very thankful...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Saveliev, 2015-11-13
@neoneel

I recommend that you use jQuery, find all the img you need, and then use the wrap() function to wrap it in a div.

$(".container img").wrap("<div></div>");  // находишь все img в элементе с классом container, после чего оборачиваешь их div'ом

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question