JavaScript image align

WE can assign or read alignment of image by this syntax .
object.align=right;
We can assign left, right , top or bottom align the image. Here is an example
Demo of Image align
Source code is here
<html>
<head>
<title>Demo of Image align in JavaScript</title>
<script language='JavaScript' type='text/JavaScript'>
<!--
function move_img(str) {
document.getElementById('i1').align=str;
}
//-->
</script>
</head>
<body>
<img src=images/help.jpg id='i1'>
<br><br><br><br>

<input type=button onClick=move_img('left') value='Left'>
<input type=button onClick=move_img('right') value='Right'>
<br><br>
</body>
</html>

Image Border
Image Object
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    name

    24-11-2014

    this is great method, thanks for your post,
    but i am using like this.

    img.src="captcha-demo.php?rand_number=" + (new Date()).getTime());

    Kade

    25-11-2016

    Works great and uses minimal code. Thank you!!

    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer