my html is:
<html>
<body>
<button id="widthPlus">increase </button>
<div id="bod"> hai </div>
<img id="tree" src="http://www.rangde.org/newsletter/nov11/images/real_tree.png" width="350"/>
</body>
</html>
my script is:
$(document).ready(function() {
$("#widthPlus").click(function(){
var currentwidth = $('#tree').attr('width');
var currentwidthNum = parseFloat(currentwidth, 350);
var newwidth = currentwidthNum+5;
$('#tree').animate({'width', newwidth}, 5000);
return false;
});
});
i am trying to increase(5px) the image width when click a button my jsfiddle is here
jsFiddle.