tawsif torabi tawsif torabi - 3 months ago 7
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>
</br>
<button onclick="pluswidth()" title="Increase Width">+</button>
<script>
function pluswidth(){
var framewidth = documen.getElementById('chkframe').width;
var frame = document.getElementById('chkframe');
var math = framewidth + 1;
frame.width = math;
}

</script>

Answer

I've Used This and got Perfect Result,

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