My collection includes a variety of embed codes from different gif/video sites, such as:
<iframe src="https://player.vimeo.com/video/122375452?title=0&byline=0&portrait=0" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
Each site utilizes different methods for embedding, like
<iframe>, <a>, <div>
, among others. What I need to accomplish is adding inline styles to the opening tag in the embed code dynamically. I considered registering the element, but that approach would introduce additional tags. How can I achieve this task, preferably using jQuery but JavaScript is also acceptable? Essentially, the embed code will be inserted into an input field and upon pasting, I need to apply the style and then display the element. Is my only option to use regex?