tawsif torabi tawsif torabi - 1 year ago 40
HTML Question

How to Increase a Iframe's Dimention clicking a Button using Javascript?

I want to increase the iframe's width clicking the "+" Button. But It doesn't works.

<iframe id="chkframe" src="" height="500" width="250" onchange="getsize()"></iframe>
<button onclick="pluswidth()" title="Increase Width">+</button>
function pluswidth(){
var framewidth = documen.getElementById('chkframe').width;
var frame = document.getElementById('chkframe');
var math = framewidth + 1;
frame.width = math;


Answer Source

I've Used This and got Perfect Result,

function incrementvaluewidth()
    var value = parseInt(document.getElementById('chkframe').width);
    value = isNaN(value) ? 0 : value;
    document.getElementById('chkframe').width = value;