Reputation: 8350
Is it possible to remove width attribute from an < iframe width="100%" >, with jQuery, either when the DOM is ready or on window.load?
Thanks
Upvotes: 0
Views: 5297
Reputation: 942
Absolutely. With jQuery:
$(document).ready(function() {
$('iframe').removeAttr('width');
});
See example here:
Upvotes: 1
Reputation: 114367
Put an ID on your iframe to make it easy:
$(document).ready(function() {
$('#myFrame').removeAttr('width');
})
Upvotes: 8