I have two JS variables X and Y. In my markup there’s a line starting with:
<iframe frameborder="0" width="600" height="337" ..
I want to replace the width’s value by X’s value and the height’s value to Y’s value. Could somebody help me with the regular expression to achieve this ?
This is not a regexp problem.
Use DOM methods to find the
<iframe>tag, and then just set its.widthand.heightproperties.For example, if there’s only one
<iframe>on the page:It would be better to put an ID tag on the
<iframe>, though:If setting those properties doesn’t work (it does on a Canvas, I haven’t tried it on an iFrame) then set the CSS style properties instead.