I have a RTE on my site, which allows the user to embed an iframe with a video. The problem is, that when the use embeds an iframe, it automatically sets the height and width to static sizes, which does not work on mobile devices. How do I search and replace the contents of the width and height element of a string, without knowing the actual width and height of the element?
Here is an example of what I would like to do:
I receive this from the view:
<iframe src="someyoutubevideo" height="100px" width="150px"/>
I would like to replace it to:
<iframe src="someyoutubevideo" height="auto" width="100%"/>
The height and width can vary though, so a simple search and replace wont work