D
DL
Hi,
The following code works fine:
var fs = document.getElementById('txt').style;
fs.height = (+fs.height.replace('px','') + 100) + 'px';
// it works.
/* suppose, the extra 100 pix is enough
but problem is, what is the user's monitor is much bigger or smaller
hence, a dynamic value such as percentage would suit the situation
better, to this end, I attempted the following
*/
fs.height = (+fs.height.replace('px','') + 40%);
// say, we want to increase height by 40%
// it does not work. How to fix it?
The above script references the following HTML code
<form>
<iframe id="txt" name="txt"/>
</form>
Many thanks.
The following code works fine:
var fs = document.getElementById('txt').style;
fs.height = (+fs.height.replace('px','') + 100) + 'px';
// it works.
/* suppose, the extra 100 pix is enough
but problem is, what is the user's monitor is much bigger or smaller
hence, a dynamic value such as percentage would suit the situation
better, to this end, I attempted the following
*/
fs.height = (+fs.height.replace('px','') + 40%);
// say, we want to increase height by 40%
// it does not work. How to fix it?
The above script references the following HTML code
<form>
<iframe id="txt" name="txt"/>
</form>
Many thanks.