Jump to content

Javascript resize image width


sastro

Recommended Posts

Here is my code

 

<script type="text/javascript">
function resize(id,va)
{
document.getElementById(id).width = va ;
}
</script>
<img src="https://www.google.com/logos/classicplus.png" id="img" height="100%">
<script type="text/javascript">resize('img','50%');</script>

 

Its not working to resize the image with % but worked without %.

I need to resize image width with persentage.

 

Please help

Link to comment
https://forums.phpfreaks.com/topic/263489-javascript-resize-image-width/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.