How can I resize an image with JavaScript

I’m new to web development.
I have a webpage in PHP in which there is an image.
I want to post this photo on a blog with this script

<div id="x"></div>

<script>
var img = document.createElement("img");
img.src = "http://www.meteoarachova.com/stickersPWS/sticker.php";
var src = document.getElementById("x");
src.appendChild(img);
</script>

how can I resize the image and put a link for the blog visitor to return to the image page?

44 thoughts on “How can I resize an image with JavaScript”

Leave a Comment