Change image relative width

cryrichter

New Member
How to change dynamically the relative percent width of an image?\[code\]<div style="width: 350px; background-color: #DDDDDD"> <img id="gradient" src="http://stackoverflow.com/questions/15853384/img.png" style="width: 74.074%;"></img></div>\[/code\]I've failed to get the width with jquery using \[code\]attr()\[/code\] or dot:\[code\]<input type="submit" value="http://stackoverflow.com/questions/15853384/button" /><script> $(function() { $( "input[type=submit], a, button" ) .button() .click(function( event ) { $("#gradiant").width; });});</script>\[/code\]
 
Back
Top